Commit 332dcf54 authored by Jim Fulton's avatar Jim Fulton Committed by GitHub

Merge pull request #31 from zopefoundation/8-windows_sock_stream

Fix connecting to 'localhost' on Windows / Solaris / Android.
parents a7a5fab7 90d15055
Changelog
=========
4.2.1 (unreleased)
------------------
- Fix bug connecting to ``localhost`` on Windows. (#8).
4.2.0 (2016-06-15)
------------------
......
......@@ -29,7 +29,6 @@ from ZEO.zrpc.error import DisconnectedError
from ZODB.POSException import ReadOnlyError
from ZODB.loglevels import BLATHER
from six.moves import map
from six.moves import zip
def client_timeout():
......@@ -453,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