UDP transport family for Swarmauri.
Project description
Swarmauri UDP Transport
The Swarmauri UDP Transport provides a datagram-oriented transport with unicast, broadcast, multicast, and anycast semantics. It plugs into the unified transport lifecycle to guarantee capability-safe server and client contexts.
Installation
Using uv
uv add --directory pkgs/standards/swarmauri_transport_udp swarmauri_transport_udp
Using pip
pip install swarmauri_transport_udp
Usage
Below is a simple example that sends a message to a UDP server, which then rebroadcasts the payload.
import asyncio
from swarmauri_transport_udp import UdpTransport
async def main():
server = UdpTransport(bind="0.0.0.0:5000", multicast_groups=["239.1.2.3"])
async def run_server():
async with server.server():
message = await server.recv()
await server.broadcast(b"broadcast:" + message)
await server.multicast(["239.1.2.3:5000"], b"multicast:" + message)
async def run_client():
client = UdpTransport()
async with client.client():
await client.send("127.0.0.1:5000", b"udp-ping")
reply = await client.recv()
print(reply.decode())
await asyncio.gather(run_server(), run_client())
asyncio.run(main())
Adjust the bind address and multicast groups to suit your environment. The
transport leaves socket configuration open so you can customize TTL, reuse,
and other behaviors as needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file swarmauri_transport_udp-0.1.0.dev11.tar.gz.
File metadata
- Download URL: swarmauri_transport_udp-0.1.0.dev11.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0544e88fd96495f379eaa436c284f7842e8f082e346dcdf5cb5e775385ab59b
|
|
| MD5 |
a98e47b3b8d63830e788f26123249b00
|
|
| BLAKE2b-256 |
98092f957554d76a2d7137411b1cf3fdd4746085d9b72f4a99de736bc2799035
|
File details
Details for the file swarmauri_transport_udp-0.1.0.dev11-py3-none-any.whl.
File metadata
- Download URL: swarmauri_transport_udp-0.1.0.dev11-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1733d462dcc670125419e69717fd049e4b29d5cd8115648f5faa1123d85b3bc
|
|
| MD5 |
5a56eb041d06f1570eab07a860a64ab4
|
|
| BLAKE2b-256 |
0f356ec2964aae8d2f94735458cbffde4c45fc1391b3cc66fecbb35a1fc14e6a
|