Resolves an address. The ``host`` argument is a string which may be a hostname or a literal IP address. Returns a `.Future` whose result is a list of (family, address) pairs, where address is a tuple suitable to pass to `socket.connect <socket.socket.connect
(
self, host: str, port: int, family: socket.AddressFamily = socket.AF_UNSPEC
)
| 354 | return DefaultLoopResolver |
| 355 | |
| 356 | def resolve( |
| 357 | self, host: str, port: int, family: socket.AddressFamily = socket.AF_UNSPEC |
| 358 | ) -> Awaitable[List[Tuple[int, Any]]]: |
| 359 | """Resolves an address. |
| 360 | |
| 361 | The ``host`` argument is a string which may be a hostname or a |
| 362 | literal IP address. |
| 363 | |
| 364 | Returns a `.Future` whose result is a list of (family, |
| 365 | address) pairs, where address is a tuple suitable to pass to |
| 366 | `socket.connect <socket.socket.connect>` (i.e. a ``(host, |
| 367 | port)`` pair for IPv4; additional fields may be present for |
| 368 | IPv6). If a ``callback`` is passed, it will be run with the |
| 369 | result as an argument when it is complete. |
| 370 | |
| 371 | :raises IOError: if the address cannot be resolved. |
| 372 | |
| 373 | .. versionchanged:: 4.4 |
| 374 | Standardized all implementations to raise `IOError`. |
| 375 | |
| 376 | .. versionchanged:: 6.0 The ``callback`` argument was removed. |
| 377 | Use the returned awaitable object instead. |
| 378 | |
| 379 | """ |
| 380 | raise NotImplementedError() |
| 381 | |
| 382 | def close(self) -> None: |
| 383 | """Closes the `Resolver`, freeing any resources used. |