| 389 | |
| 390 | |
| 391 | def _resolve_addr( |
| 392 | host: str, port: int, family: socket.AddressFamily = socket.AF_UNSPEC |
| 393 | ) -> List[Tuple[int, Any]]: |
| 394 | # On Solaris, getaddrinfo fails if the given port is not found |
| 395 | # in /etc/services and no socket type is given, so we must pass |
| 396 | # one here. The socket type used here doesn't seem to actually |
| 397 | # matter (we discard the one we get back in the results), |
| 398 | # so the addresses we return should still be usable with SOCK_DGRAM. |
| 399 | addrinfo = socket.getaddrinfo(host, port, family, socket.SOCK_STREAM) |
| 400 | results = [] |
| 401 | for fam, socktype, proto, canonname, address in addrinfo: |
| 402 | results.append((fam, address)) |
| 403 | return results # type: ignore |
| 404 | |
| 405 | |
| 406 | class DefaultExecutorResolver(Resolver): |