'Return the two sockets which make up a new TCP connection.'

def _connectedPair(self):

    (client, server) = socketpair()
    self.addCleanup(client.close)
    self.addCleanup(server.close)
    return (client, server)
