proto and type args

This commit is contained in:
Jack Robison 2019-02-05 13:36:25 -05:00
parent 7fe211d134
commit 073ffdd049
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -153,6 +153,6 @@ async def resolve_host(url: str, port: int, proto: str) -> str:
loop = asyncio.get_running_loop()
return (await loop.getaddrinfo(
url, port,
proto=socket.IPPROTO_TCP if proto == 'tcp' else socket.SOCK_DGRAM,
type=socket.SOCK_STREAM
proto=socket.IPPROTO_TCP if proto == 'tcp' else socket.IPPROTO_UDP,
type=socket.SOCK_STREAM if proto == 'tcp' else socket.SOCK_DGRAM
))[0][4][0]