Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eerimoq/asyncudp
Asyncio high level UDP sockets.
https://github.com/eerimoq/asyncudp
Last synced: 4 days ago
JSON representation
Asyncio high level UDP sockets.
- Host: GitHub
- URL: https://github.com/eerimoq/asyncudp
- Owner: eerimoq
- License: mit
- Created: 2021-05-15T09:25:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T14:44:10.000Z (over 1 year ago)
- Last Synced: 2024-05-01T20:26:08.551Z (6 months ago)
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 23
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
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
============.. code-block:: python
$ pip install asyncudp
Example client
==============.. code-block:: python
import asyncio
import asyncudpasync 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
==============.. code-block:: python
import asyncio
import asyncudpasync 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
====.. code-block::
$ python3 -m unittest