Skip to content

eerimoq/asyncudp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Asyncio high level UDP sockets.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages