コード例 #1
0
ファイル: base.py プロジェクト: kusoof/wprof
    def connect(self):
        """Start connection to remote server."""
        if self.state != "disconnected":
            raise RuntimeError, "can't connect in this state"

        self.state = "connecting"
        if not self.factoryStarted:
            self.factory.doStart()
            self.factoryStarted = 1
        self.transport = transport = self._makeTransport()
        if self.timeout is not None:
            self.timeoutID = self.reactor.callLater(self.timeout, transport.failIfNotConnected, error.TimeoutError())
        self.factory.startedConnecting(self)
コード例 #2
0
 def _timeoutZone(self, d, controller, connector, seconds):
     connector.disconnect()
     controller.timeoutCall = None
     controller.deferred = None
     d.errback(error.TimeoutError("Timeout after %ds" % (seconds, )))
コード例 #3
0
 def outgoingConnectionFailed(self):
     """
     The connection never got anywhere.  Goodbye.
     """
     # XXX CONNECTOR API OMFG
     self.factory.clientConnectionFailed(None, error.TimeoutError())
コード例 #4
0
 def timeoutConnection(self):
     """When a timeout occurs, kill the process and record a TimeoutError.
     """
     self.unexpectedError(failure.Failure(error.TimeoutError()))
コード例 #5
0
 def _timeout(self, user_defer):
     '''Handles a deferred timeout.'''
     if not user_defer.called:
         user_defer.errback(error.TimeoutError('Server did not respond.'))
コード例 #6
0
ファイル: xmlcurl.py プロジェクト: prashant-lintel/Mypoject
 def sendTimeout(self, df, req):
     if df.called:
         log.debug("Request already finished")
         return
     else:
         self.sendError(error.TimeoutError(), req)
コード例 #7
0
ファイル: client.py プロジェクト: hitzjd/Balance-Simulate
    def handle_disconnected_connect(self):
        self.state = "connecting"
        if not self.factoryStarted:
            self.factory.doStart()
            self.factoryStarted = True

        if self.timeout is not None:
            self.timeoutID = self.reactor.callLater(self.timeout, self.connectionFailed, failure.Failure(error.TimeoutError()))

        self.sub = _SubConnector(self)
        self.sub.startConnecting()

        self.factory.startedConnecting(self)
コード例 #8
0
ファイル: ptcp.py プロジェクト: varunshah1106/vertex
 def transition_SYN_SENT_to_CLOSED(self):
     """
     The connection never got anywhere.  Goodbye.
     """
     # XXX CONNECTOR API OMFG
     self.factory.clientConnectionFailed(None, error.TimeoutError())