Skip to main content

简介

PPNetwork 是无中心节点的网络驱动,可以在任何环境下建立数据连接。

PPNetwork采用UDP,自动寻找同类节点,并自动寻找到目标地址的路径,发送数据。

至少需要添加一个初始的对等节点。可以通过对等节点获得其邻居信息,逐渐扩大自己的网络。上层应用可以通过寻找好友的方式添加对等节点。

安装

pip install py-ppnet

使用

ppnetwork 不能独立运行,需要根据接口,开发上层应用。 需要至少一个可访问到的peer节点,可以通过配置也可以在运行时动态增加。

config模式

config.yaml:

node_port: 54320
nodes: [["172.31.102.109",54320]]

程序代码:

from ppnet import PPNetNode

ppnetnode = PPNetNode(config=config)
ppnetnode.start()
ppnetnode.send(data,addr1)
data,addr2 = ppnetnode.receive(count)
...
ppnetnode.quit()

动态增加模式

程序代码:

from ppnet import PPNetNode

ppnetnode = PPNetNode(node_port=54320)
ppnetnode.set_peer(addr)
ppnetnode.start()
ppnetnode.send(data,addr1)
data,addr2 = ppnetnode.receive(count)
...
ppnetnode.quit()

Metadata

Release files for py-ppnet 1.0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-ppnet 1.0.5.0
File Size Uploaded Provenance
py-ppnet-1.0.5.0.tar.gz 42.4 kB Without provenance Details

Release files / py-ppnet-1.0.5.0.tar.gz

Download URL py-ppnet-1.0.5.0.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
17af93833ca2f508df94a6371945cf86643b2f9f21c02ce94f93d70c385e1046
BLAKE2b-256 checksum
How to use checksums
7c8c2fa5825e346de67f223475c2dfc84653cf4b4915ff2edf0e9de3e9b2a5ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.0

Security for py-ppnet 1.0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.5.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page