def add_client(self, transport): """Setup a client instance for this transport, and add it to the general client-list :param transport transport: A representation of the socket connection :return: client - Return the client object for further processing """ new_client = Client(transport.profile, transport.session, 'nl') new_client.transport = transport self.clients.append(new_client) log.msg('%s WS/76/HRM' % ('New client added...'),system='%s,IN' % transport.getPeer().host) self.signals.send('ws_connect', client = new_client) return new_client
def add_client(self, transport): """Setup a client instance for this transport, and add it to the general client-list :param transport transport: A representation of the socket connection :return: client - Return the client object for further processing """ new_client = Client(transport.profile, transport.session, 'nl') new_client.transport = transport HWIOS.ws_realm.pool.clients.append(new_client) log.msg('%s WS/76/HRM' % ('New client added...'),system='%s,IN' % transport.getPeer().host) self.signals.send('ws_connect', client = new_client) userlist = self._get_userlist() for _client in self.clients: #only send online update notification to already connected clients. New client will make it's own request if _client.transport != new_client: _client.remote('/data/modules/messenger/online/update/',{'online':userlist}) return new_client