persistent TCP connection in python using socketserver

markobrien85 at gmail.com markobrien85 at gmail.com
Thu Jan 29 11:38:43 EST 2009


G'day

I'm currently using socketserver to build a simple XMLSocket (an XML
based protocol used for communication between flash and the outside
world) server. I've got flash establishing a connection, sending a
request and my python server responding. However at this point
socketserver terminates the connection. Which is bad, since i need a
persistent connection so i can push data from the server to the client
without the overhead of polling.

I need to create TCP connection that persists until I explicitly tell
it to terminate, or the connection is terminated on the other end. A
quick look through the socketserver code makes this seem impossible
since it appears to call close after the handle() method.

Is there an even lower level library to be using, or is there some
option I haven't found yet in socketserver.

Cheers



More information about the Python-list mailing list