noc.core.ioloop.udp

Module Contents

noc.core.ioloop.udp._ERRNO_WOULDBLOCK
class noc.core.ioloop.udp.UDPSocket(ioloop=None, tos=None)

Bases: object

UDP socket abstraction

@tornado.gen.coroutine def test():

sock = UDPSocket() # Send request yield sock.sendto(data, (address, port)) # Wait reply data, addr = yield sock.recvfrom(4096) # Close socket sock.close()
__del__(self)
get_future(self)

Get future and start timeout task when needed

settimeout(self, timeout)

Set timeout for following blocking operations

get_timeout(self)
start_timeout(self)
stop_timeout(self)
add_handler(self, callback, events)
remove_handler(self)
recvfrom(self, bufsize)
sendto(self, data, address)
on_read(self, fd, events)
on_write(self, fd, events)
on_timeout(self)
close(self)