Metadata-Version: 2.1
Name: asyncudp
Version: 0.11.0
Summary: Asyncio high level UDP sockets.
Home-page: https://github.com/eerimoq/asyncudp
Author: Erik Moqvist
Author-email: erik.moqvist@gmail.com
License: MIT
Keywords: asyncio
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
License-File: LICENSE

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 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
==============

.. code-block:: python

   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
====

.. code-block::

   $ python3 -m unittest
