From ca4fd6680e077d0951a01ff696e40eaf875bb89f Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Sun, 16 Jul 2017 00:19:30 -0700 Subject: [PATCH] Connect to localhost instead of the socket's binding address. The bound address is 0.0.0.0 which usually implies all available interfaces, which makes sense when listening for something. However, when connecting to an address, a specific address needs to be targeted. Hopefully, any properly configured computer should have `localhost` pointing to its loopback interface. Fixes #64 --- tests/test_connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_connection.py b/tests/test_connection.py index e90e3a0..a0b194a 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -21,7 +21,8 @@ THREAD_TIMEOUT_S = 5 class _ConnectTest(unittest.TestCase): def _test_connect(self, client_version=None, server_version=None): server = FakeServer(minecraft_version=server_version) - addr, port = server.listen_socket.getsockname() + addr = "localhost" + port = server.listen_socket.getsockname()[1] cond = threading.Condition()