Low-to-mid level wrapper for multicast sockets
Project description
multicast.py
Low-to-mid level wrapper for multicast sockets. Simple and cross-platform.
The library is typed, but if you want: DOCS HERE.
Installation
pip install multicast_py
Usage
Creation socket to send multicast packets:
s = MulticastSocket()
s.multicast_ttl = 2 # if needed
s.multicast_loop = False # if needed, POSIX only (on Windows does nothing)
s.set_multicast_if(address='192.168.0.101') # local ip, used almost always
s.sendto(b'Multicast message', (group_address, group_port)) # send multicast message
Creation socket to receive multicast packets:
s = MulticastSocket()
s.reuse_addr = True # if needed
s.multicast_loop = False # if needed, Windows only (on POSIX does nothing)
s.bind_multicast((group_address, group_port))
s.add_membership(group_address) # also can specify local address
data = s.recvfrom(1024) # receive multicast message
License
MIT License. Full test available in LICENSE file.
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
multicast_py-1.0.0.tar.gz
(4.8 kB
view details)
Built Distribution
File details
Details for the file multicast_py-1.0.0.tar.gz
.
File metadata
- Download URL: multicast_py-1.0.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a63ecbdb35ba95172b59b0afa8db13ac9230840dde4ed84c4e7da13d450ae026 |
|
MD5 | 023b4e4ce247f79ae4503a44a9c3b021 |
|
BLAKE2b-256 | 2d33ad7bc81cc159f5051774d4276d88f3f27c59693702b25966419fde144849 |
File details
Details for the file multicast_py-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: multicast_py-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86df83cff349adaf28638bf2714f2d8b2569821f95f899a58ef1354bd3d2cff6 |
|
MD5 | 191f4fa6a83cb8102a1de06925964725 |
|
BLAKE2b-256 | 69712a57629f30da3a14bbe7ae6407db988ffce5b260ea902e60ab92a56beaa7 |