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

View File

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