def GWConnectionMade(self, p): if p is None: reactor.stop() else: p.setTimeout( None ) res = yield p.call('registersrv', 'ms') print ('registedGW: result:%s, me:%s, peer:%s.' % (res, p.transport.getHost(), p.transport.getPeer())) if res[0] == 0: protocol_manager.set_server('gw', p)
def MSConnectionMade(self, p): if p is None: reactor.stop() else: p.setTimeout( None ) res = yield p.call('registersrv', 'gs') log.info('registedMS: result: {0}, me: {1}, peer: {2}.'.format( res, p.transport.getHost(), p.transport.getPeer() )) if res[0] == 0: protocol_manager.set_server('ms', p)
def GWConnectionMade(self, p): if p is None: reactor.stop() else: p.setTimeout(None) res = yield p.call('registersrv', 'ms') print('registedGW: result:%s, me:%s, peer:%s.' % (res, p.transport.getHost(), p.transport.getPeer())) if res[0] == 0: protocol_manager.set_server('gw', p)
def MSConnectionMade(self, p): if p is None: reactor.stop() else: p.setTimeout(None) res = yield p.call('registersrv', 'gs') print('registedMS: result: {0}, me: {1}, peer: {2}.'.format( res, p.transport.getHost(), p.transport.getPeer())) if res[0] == 0: protocol_manager.set_server('ms', p)
def registersrv(p, req): srv = req p.setTimeout( None ) protocol_manager.set_server(srv, p) return (0, 0)