asyncio: Use socket specs for getaddrinfo() in sock_connect()

Patch by Martin Richard.  GH PR #365.
This commit is contained in:
Yury Selivanov 2016-06-28 11:00:22 -04:00
parent 77bc04a3bc
commit 63bf487688
2 changed files with 13 additions and 1 deletions

View file

@ -394,7 +394,8 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
if hasattr(socket, 'AF_UNIX') and sock.family == socket.AF_UNIX:
self._sock_connect(fut, sock, address)
else:
resolved = base_events._ensure_resolved(address, loop=self)
resolved = base_events._ensure_resolved(
address, family=sock.family, proto=sock.proto, loop=self)
resolved.add_done_callback(
lambda resolved: self._on_resolved(fut, sock, resolved))