TCPClient always calls resolver.resolve( even if "host" is already an IP
|
if timeout is not None: |
|
addrinfo = await gen.with_timeout( |
|
timeout, self.resolver.resolve(host, port, af) |
|
) |
|
else: |
|
addrinfo = await self.resolver.resolve(host, port, af) |
asyncio has a nice implementation that skips the getaddrinfo call https://github.com/python/cpython/blob/b5527688aae11d0b5af58176267a9943576e71e5/Lib/asyncio/base_events.py#L1369-L1380 in this case
TCPClient always calls
resolver.resolve(even if"host"is already an IPtornado/tornado/tcpclient.py
Lines 260 to 265 in 00c9e0a
asyncio has a nice implementation that skips the getaddrinfo call https://github.com/python/cpython/blob/b5527688aae11d0b5af58176267a9943576e71e5/Lib/asyncio/base_events.py#L1369-L1380 in this case