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
This commit is contained in:
Ammar Askar 2017-07-16 00:19:30 -07:00
parent 2cf1d3cb03
commit ca4fd6680e
No known key found for this signature in database
GPG Key ID: 5466BE9666B54DED
1 changed files with 2 additions and 1 deletions

View File

@ -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()