'This is a hook for when a connection attempt has succeeded.
Here, we build the protocol from the
L{twisted.internet.protocol.ClientFactory} that was passed in, compute
a log string, begin reading so as to send traffic to the newly built
protocol, and finally hook up the protocol itself.
This hook is overridden by L{ssl.Client} to initiate the TLS protocol.'

def _connectDone(self):

    self.protocol = self.connector.buildProtocol(self.getPeer())
    self.connected = 1
    logPrefix = self._getLogPrefix(self.protocol)
    self.logstr = ('%s,client' % logPrefix)
    if (self.protocol is None):
        self.protocol = Protocol()
        self.loseConnection()
    else:
        self.startReading()
        self.protocol.makeConnection(self)
