def startBridge( sock1, sock2, reactor, routerState ) : bridge = TCPBridge( sock1, sock2, reactor ) routerState.bridges[bridge] = 1 def onClose() : logger.info('delete bridge %s' % bridge.id) del routerState.bridges[bridge] bridge.setCloseCallback( onClose )
def _onMessage( self, msg ) : sock1,sock2,notifytq = msg bridge = TCPBridge( sock1, sock2, self.reactor ) bridge.setCloseCallback( lambda : notifytq.postMessage(True) )
def _onMessage(self, msg): sock1, sock2, notifytq = msg bridge = TCPBridge(sock1, sock2, self.reactor) bridge.setCloseCallback(lambda: notifytq.postMessage(True))
def startBridge( sock1, sock2, reactor, routerState ) : bridge = TCPBridge( sock1, sock2, reactor ) routerState.bridges[bridge] = 1 def onClose() : del routerState.bridges[bridge] bridge.setCloseCallback( onClose )