def loopback(server_factory=None, client_factory=None):
if server_factory is None:<EOL><INDENT>server_factory = loopback_server_factory<EOL><DEDENT>if client_factory is None:<EOL><INDENT>client_factory = loopback_client_factory<EOL><DEDENT>(server, client) = socket_pair()<EOL>server = server_factory(server)<EOL>client = client_factory(client)<EOL>handshake(client, server)<EOL>server.setblocking(True)<EOL>client.setblocking(True)<EOL>return server, client<EOL>
Create a connected socket pair and force two connected SSL sockets
to talk to each other via memory BIOs.