Go to the latest version of this document.

# ``twisted`.`internet`.`testing`.`SynchronousResolver``

class documentation

`class SynchronousResolver: (source)`

Implements interfaces: `twisted.internet.interfaces.IHostnameResolver`

View In Hierarchy

A very simple `IHostnameResolver` that immediately, synchronously resolves all host names to a single static address (TCPv4, 127.0.0.1) while preserving any requested port number.

Method | `resolveHostName` | Implement `IHostnameResolver.resolveHostName` to synchronously resolve the name and complete resolution before returning.

def resolveHostName(self, resolutionReceiver: `IResolutionReceiver`, hostName: `str`, portNumber: `int` = 0, addressTypes: `Sequence[type[IAddress]] | None` = None, transportSemantics: `str` = 'TCP') -> `IHostResolution`: (source)
from `twisted.internet.interfaces.IHostnameResolver`

Implement `IHostnameResolver.resolveHostName` to synchronously resolve the name and complete resolution before returning.