def _handshake_test(self, serverContext, clientContext):
    '\n        Verify that a client and server created with the given contexts can\n        successfully handshake and communicate.\n        '
    (serverSocket, clientSocket) = socket_pair()
    server = Connection(serverContext, serverSocket)
    server.set_accept_state()
    client = Connection(clientContext, clientSocket)
    client.set_connect_state()
    for _ in range(3):
        for s in [client, server]:
            try:
                s.do_handshake()
            except WantReadError:
                pass
Verify that a client and server created with the given contexts can
successfully handshake and communicate.
def _handshake_test(self, serverContext, clientContext):
    '\n        Verify that a client and server created with the given contexts can\n        successfully handshake and communicate.\n        '
    (serverSocket, clientSocket) = socket_pair()
    server = Connection(serverContext, serverSocket)
    server.set_accept_state()
    client = Connection(clientContext, clientSocket)
    client.set_connect_state()
    for _ in range(3):
        for s in [client, server]:
            try:
                s.do_handshake()
            except WantReadError:
                pass