[Twisted-Python] pb, viewable, avatars: The example chatserver is buggy
Wolfgang Rohdewald
wolfgang at rohdewald.de
Tue Nov 17 17:12:51 MST 2009
I tried this example:
http://twistedmatrix.com/projects/core/documentation/howto/pb-cred.html#auto18
(scripts chatserver.py and chatclient.py)
but they do not work with python 2.6.4 (twisted 8.2.0).
Before the client can do much, the server function
User.detached is called resulting in an exception later
when User.send is called but self.remote is None.
I can fix this by changing chatclient.py:
def connected(self, perspective):
self.perspective = perspective
... and continue as in the original script
it seems that otherwise the perspective is destroyed
too early.
also the documentation should perhaps mention that the
client can only connect to the server once because the
server code does not remove a user from her group when
she detaches.
Is there any more complete example anywhere with better
error handling?
--
Wolfgang
More information about the Twisted-Python
mailing list