udp support in tornado

245 views
Skip to first unread message

cong

unread,
Feb 15, 2012, 2:30:03 AM2/15/12
to python-...@googlegroups.com
Hi
As we know,while tornado focus on http, at the same time,it can be used as a very good tcp server using the netutil.TCPServer. I already use tornado in my tcp servers, but I also want it to support udp and use tornado in my udp servers.
There should be some changes in IOStream class but I am not sure how to implement one that is solid enough. Any ideas,or are there some projects focusing on this?

Ben Darnell

unread,
Feb 15, 2012, 2:31:57 PM2/15/12
to python-...@googlegroups.com
UDP is not a stream-oriented protocol so you wouldn't really be able
to use or adapt IOStream. You can use IOLoop.add_handler directly to
watch for incoming data on a UDP socket. You could bundle this up in
an IOStream-like class for datagram protocol, although it would be
much smaller and simpler than IOStream since many of the concepts in
IOStream don't really apply.

-Ben

Reply all
Reply to author
Forward
0 new messages