fixes connection isssue#87 (#105)

This commit is contained in:
Martin 2021-09-17 19:22:20 +02:00 committed by GitHub
parent 2e22b232fb
commit ae4137364e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -187,8 +187,10 @@ async def _async_resolve_host_getaddrinfo(
eventloop: asyncio.events.AbstractEventLoop, host: str, port: int
) -> List[AddrInfo]:
try:
# Limit to TCP IP protocol
res = await eventloop.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)
# Limit to TCP IP protocol and SOCK_STREAM
res = await eventloop.getaddrinfo(
host, port, type=socket.SOCK_STREAM, proto=socket.IPPROTO_TCP
)
except OSError as err:
raise APIConnectionError("Error resolving IP address: {}".format(err))