예제 #1
0
 def connected(self, client):
     # assign the client, host, and port to the namespace for later use
     self.client = client
     address = self.client.broker.transport.getPeer()
     self.host, self.port = address.host, address.port
     Pingable.connected(self)
     logger.info("%s has connected." % self)
예제 #2
0
 def disconnected(self, client):
     logger.info("%s has disconnected." % self)
     # clean up the namespace
     self.client = None
     self.host = None
     self.port = None
     Pingable.disconnected(self)
예제 #3
0
 def __init__(self, loginID, *args, **kwargs):
     self.username = loginID
     self.client = None
     Pingable.__init__(self, *args, **kwargs)