'Start connection to remote server.'

def connect(self):

    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)
