Asyncio high level UDP sockets.
Project description
Asyncio high level UDP sockets
Asyncio high level UDP sockets.
Project homepage: https://github.com/eerimoq/asyncudp
Documentation: https://asyncudp.readthedocs.org/en/latest
Installation
$ pip install asyncudp
Example client
import asyncio
import asyncudp
async def main():
sock = await asyncudp.create_socket(remote_addr=('127.0.0.1', 9999))
sock.sendto(b'Hello!')
print(await sock.recvfrom())
sock.close()
asyncio.run(main())
Example server
import asyncio
import asyncudp
async def main():
sock = await asyncudp.create_socket(local_addr=('127.0.0.1', 9999))
while True:
data, addr = await sock.recvfrom()
print(data, addr)
sock.sendto(data, addr)
asyncio.run(main())
Test
$ python3 -m unittest
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
asyncudp-0.11.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for asyncudp-0.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96d859d86471e3ed30cf9f05cb38e96920156e3a9fe70ee916096ba758ea316e |
|
MD5 | d90226c138344f1cf41893edcbeca01c |
|
BLAKE2b-256 | 17fe77f4a24264e728fd95542e53f026a91249b51d1611087b8c82d3a033ea97 |