Exemplo n.º 1
0
 def __call__(self,socket,address):
     """每当有客户端连接产生是会被调用\n
     """
     t = Transport(socket,address,self.sessionno)
     t.start()
     self.buildProtocol(t)
     p = self.protocol(t,self)
     p.start()
     self.sessionno +=1
Exemplo n.º 2
0
 def __call__(self,socket,address):
     """每当有客户端连接产生是会被调用\n
     """
     t = Transport(socket,address,self.sessionno)
     t.start()
     self.buildProtocol(t)
     p = self.protocol(t,self)
     p.start()
     self.sessionno +=1
Exemplo n.º 3
0
 def startedConnecting(self,connector):
     """开始建立连接\n
     @param connector: BaseConnector (详见gtwisted.core.base 中对BaseConnector的定义)\n
     """
     address = connector.getHost()
     client = create_connection(address)
     t = Transport(client,address)
     t.start()
     self.buildProtocol(t)
     self._protocol = self.protocol(t,self)
Exemplo n.º 4
0
 def startedConnecting(self,connector):
     """开始建立连接\n
     @param connector: BaseConnector (详见gtwisted.core.base 中对BaseConnector的定义)\n
     """
     address = connector.getHost()
     client = create_connection(address)
     t = Transport(client,address)
     t.start()
     self.buildProtocol(t)
     self._protocol = self.protocol(t,self)
Exemplo n.º 5
0
 def __call__(self, socket, address):
     """每当有客户端连接产生是会被调用\n
     """
     t = Transport(socket, address, self.sessionno)
     t.start()
     self.buildProtocol(t)
     p = self.protocol(t, self)
     p.start()
     self.sessionno += 1
     #As mentioned, that is the desired behaviour. Keep the handler alive to keep the socket alive.
     # while 1:
     #     gevent.sleep(300)
     t.join()