interface documentation

class twisted.internet.interfaces.IReactorTCP(Interface): (source)

Known implementations: twisted.internet.iocpreactor.reactor.IOCPReactor, twisted.internet.posixbase.PosixReactorBase, twisted.internet.testing.MemoryReactor, twisted.internet.testing.RaisingMemoryReactor

View In Hierarchy


Method listenTCP Connects a given protocol factory to the given numeric TCP/IP port.
Method connectTCP Connect a TCP client.
def listenTCP(port, factory, backlog, interface): (source)

Connects a given protocol factory to the given numeric TCP/IP port.

Parametersporta port number on which to listen (type: int)
factorya twisted.internet.protocol.ServerFactory instance (type: ServerFactory)
backlogsize of the listen queue (type: int)
interfaceThe local IPv4 or IPv6 address to which to bind; defaults to '', ie all IPv4 addresses. To bind to all IPv4 and IPv6 addresses, you must call this method twice. (type: str)
Returnsan object that provides IListeningPort. (type: IListeningPort)
RaisesCannotListenErroras defined here twisted.internet.error.CannotListenError, if it cannot listen on this port (e.g., it cannot bind to the required port number)
def connectTCP(host, port, factory, timeout, bindAddress): (source)

Connect a TCP client.

ParametershostA hostname or an IPv4 or IPv6 address literal. (type: bytes)
porta port number (type: int)
factorya twisted.internet.protocol.ClientFactory instance (type: ClientFactory)
timeoutnumber of seconds to wait before assuming the connection has failed. (type: float)
bindAddressa (host, port) tuple of local address to bind to, or None. (type: Optional[Tuple[str, int]])
ReturnsAn object which provides IConnector. This connector will call various callbacks on the factory when a connection is made, failed, or lost - see ClientFactory docs for details. (type: IConnector)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.