'Set up an in-memory connection between protocols created by
C{serverFactory} and C{clientFactory}.
@return: A three-tuple.  The first element is the protocol created by
C{serverFactory}.  The second element is the protocol created by
C{clientFactory}.  The third element is the L{IOPump} connecting
them.'

def connectedServerAndClient(self, serverFactory, clientFactory):

    clientProtocol = clientFactory.buildProtocol(None)
    serverProtocol = serverFactory.buildProtocol(None)
    clientTransport = AbortableFakeTransport(clientProtocol, isServer=False, hostAddress=self.clientAddress, peerAddress=self.serverAddress)
    serverTransport = AbortableFakeTransport(serverProtocol, isServer=True, hostAddress=self.serverAddress, peerAddress=self.clientAddress)
    pump = connect(serverProtocol, serverTransport, clientProtocol, clientTransport)
    return (serverProtocol, clientProtocol, pump)
