Hi,

I am using twisted in a cross-platform manner. I have written both the
client and server. The client is twisted and the server uses python threads.
I am using the select reactor and plain old TCP connections. I encode my
messages to JSON to send them.

On Windows I get tons of un-clean connectionlost events, on Mac everything
works perfectly. I am using the same data set in each case.

If I use the threaded server on windows and the twisted client on mac then I
still get tons of errors. 99% of these times these errors happen after the
last dataReceived when the socket should be closed cleanly.

My threaded code is:
        try:
            (clientsocket, address) = serversocket.accept()
        except Exception, e:
            print "Exception ", e, clientsocket
        try:
            p = processrequest()
            p.set_socket(clientsocket)
            p.start()

and in processrequest
self.sock.send_all(my_json_message)
self.sock.close()

Is this the correct behavior for using plain sockets with twisted? Any
reason why this would be perfectly fine on OSX and not Windows? Sorry for
the long email.

Thank you very very much,
Dan
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to