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)
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)
def __init__(self, loginID, *args, **kwargs): self.username = loginID self.client = None Pingable.__init__(self, *args, **kwargs)