Hi,<br>I am trying to figure out how to keep an continuously updated list of connected clients to a PB server. <br>I have had success in figuring out how to add clients to my list when they connect, but I am not sure what methods get called when a client disconnects.
<br><br>This is what I have so far:<br><br>from twisted.spread import pb<br><br>class DSagePBServerFactory(pb.PBServerFactory):<br> def __init__(self, root):<br> pb.PBServerFactory.__init__(self, root)<br>
self.clients = []<br><br> def clientConnectionMade(self, broker):<br> """Keeps a 3-tuple of connected clients.<br> tuple[0] - the broker transport<br> tuple[1] - the clients ip<br> tuple[2] - the clients port
<br><br> """<br> self.clients.append((broker.transport, <br> broker.transport.getPeer().host,<br> broker.transport.getPeer().port))<br> print
self.clients<br><br>There does not seem to be a corresponding clientConnectionLost method for the Factory class. Any suggestions would be appreciated.<br><br>Yi<br><br>