def __enter__(self):
        self.listen_socket = socket.socket()
        self.listen_socket.bind(("0.0.0.0", 0))
        self.listen_socket.listen(1)
        self.address, self.port = self.listen_socket.getsockname()
        self.fixtures.push(lambda *exc_info: self.listen_socket.close())
        self.event = threading.Event()

        self.ssh_connection = self.workspace.add_ssh_connection(
            name="test-ssh-connection", hostname=self.address, port=self.port
        )

        self.listen_thread = threading.Thread(target=self.server_thread)
        self.listen_thread.daemon = True
        self.listen_thread.start()

        return self