'Implement L{IStreamClientEndpoint.connect} to connect via TCP,
once the hostname resolution is done.'

def connect(self, protocolFactory):

    if isIPv6Address(self._host):
        d = self._resolvedHostConnect(self._host, protocolFactory)
    else:
        d = self._nameResolution(self._host)
        d.addCallback((lambda result: result[0][self._GAI_ADDRESS][self._GAI_ADDRESS_HOST]))
        d.addCallback(self._resolvedHostConnect, protocolFactory)
    return d
