Commit 90d15055 authored by Tres Seaver's avatar Tres Seaver

Fix connecting to 'localhost' on Windows / Solaris / Android.

Closes #8.

Closes #30.
parent 1bd6bd93
Changelog
=========
4.2.1 (unreleased)
------------------
- Fix bug connecting to ``localhost`` on Windows. (#8).
4.2.0 (2016-06-15)
------------------
......
......@@ -452,12 +452,10 @@ class ConnectThread(threading.Thread):
if domain == socket.AF_INET:
host, port = addr
for (family, socktype, proto, cannoname, sockaddr
) in socket.getaddrinfo(host or 'localhost', port):
# we only speak TCP, so let's skip UDP and RAW sockets
# otherwise we'll try to connect to the same address
# three times in a row
if socktype != socket.SOCK_STREAM:
continue
) in socket.getaddrinfo(host or 'localhost', port,
socket.AF_INET,
socket.SOCK_STREAM
): # prune non-TCP results
# for IPv6, drop flowinfo, and restrict addresses
# to [host]:port
yield family, sockaddr[:2]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment