Skip to main content

UDP transport family for Swarmauri.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_transport_udp Discord

Swarmauri UDP Transport

Transport Icon Casts Lifecycle

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_transport_udp-0.11.0.dev1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_transport_udp-0.11.0.dev1.tar.gz.

File metadata

  • Download URL: swarmauri_transport_udp-0.11.0.dev1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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

Hashes for swarmauri_transport_udp-0.11.0.dev1.tar.gz
Algorithm Hash digest
SHA256 f5fd118a148c83e7b531522a1f774404a1c3fe6dbbb7d4fdf857fe90c3abda36
MD5 164f49ae363bfca153bea5687cb3eaea
BLAKE2b-256 fea8296de02cd043fb883aa2d2f3abe1d64bf375bdcb0415bc2d863d299ec5d2

See more details on using hashes here.

File details

Details for the file swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","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

Hashes for swarmauri_transport_udp-0.11.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 67a120898a49b721d05236afc93d5d0e6257ab780651623759e944ff1258a949
MD5 bc72e87077fa48f4b4c5c7039651ad5f
BLAKE2b-256 df727655e1da7a37a158de932dd0b063b3e3e0998b6028b4820613bf9a73b08a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page