Exemplo n.º 1
0
 def connectionMade(self):
     """
     When a connection is made, a timeout timer is started,
     and if the user does not request connection acceptance
     within reasonable time, disconnect (to prevent flood attacks).
     """
     BaseProtocol.connectionMade(self)
     timeOut = self.factory.timeOut
     if timeOut is not None:
         self._timeoutCall = reactor.callLater(timeOut, self._timedOut)
Exemplo n.º 2
0
 def connectionMade(self):
     """
     Sends a connection acceptance request to the server
     after the connection has been made.
     """
     BaseProtocol.connectionMade(self)
     self._udpCheck = LoopingCall(self._requestUDP)
     self._channelList = []
     self._channelListDefer = []
     hello = client.Request()
     hello.request = CONNECT
     hello.version = self.revision
     self.transport.write('\x00')
     self.sendLoader(hello)