def __init__(self, endpointA, endpointB):
        assert endpointA != endpointB

        # Register the endpoints and create Protocol proxies
        self._serverEndpoint = endpointA
        self._clientEndpoint = endpointB

        self._serverProtocol = Protocol(endpointA)
        self._clientProtocol = Protocol(endpointB)

        # Create the keys used to validate the connection
        connectionID = uuid4().bytes
        serverKey = uuid4().bytes
        clientKey = uuid4().bytes

        # Create Validators and get result Deferred
        authServer = _ConnectionValidator(serverKey)
        authClient = _ConnectionValidator(clientKey)
        authServerResult = authServer.result
        authClientResult = authClient.result

        authenticator = DeferredList([authServerResult, authClientResult])
        authenticator.addCallback(self._validate)
        authenticator.addErrback(self._logError)

        readyServer = endpointA.prepareConnection(connectionID, serverKey,
                                                  authClient)
        readyClient = endpointB.prepareConnection(connectionID, clientKey,
                                                  authServer)
        ready = DeferredList([readyServer, readyClient])
        ready.addCallback(self._getAddress)
        ready.addCallback(self._connect, connectionID)
        ready.addErrback(self._connectPrepError, authenticator)
        ready.addErrback(self._logError)
Initialize the connection between the two endpoints.
dataset/ETHPy150Open rapyuta/rce/rce-core/rce/core/network.py/EndpointConnection.__init__