Skip to content

Asynchronous packet(UDP,ICMP,etc) based IO for python-Tornado.

License

Notifications You must be signed in to change notification settings

eliric/tornado-iopacket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tornado-iopacket

Packet(udp,raw_socket etc) based io support for tornado
Coroutine is supported as well

Usage:


from socket import *
import iopacket
import tornado.gen

_sock = socket(AF_INET, SOCK_DGRAM)
_sock.bind(('localhost', 18888))
sock = iopacket.IOPacket(_sock, max_packet_size=4096)


@tornado.gen.coroutine
def write(data, dest_ip, port):
    yield sock.write(packet , (dest_ip,port))
    
@tornado.gen.coroutine
def read():
    data, address = yield sock.read()

About

Asynchronous packet(UDP,ICMP,etc) based IO for python-Tornado.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages