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
Undocumented
Method | listenTCP | Connects a given protocol factory to the given numeric TCP/IP port. |
Method | connectTCP | Connect a TCP client. |
Connects a given protocol factory to the given numeric TCP/IP port.
Parameters | port | a port number on which to listen (type: int ) |
factory | a twisted.internet.protocol.ServerFactory instance (type: ServerFactory ) | |
backlog | size of the listen queue (type: int ) | |
interface | The 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 ) | |
Returns | an object that provides IListeningPort . (type: IListeningPort ) | |
Raises | CannotListenError | as defined here twisted.internet.error.CannotListenError , if it cannot listen on this port (e.g., it cannot bind to the required port number) |
Connect a TCP client.
Parameters | host | A hostname or an IPv4 or IPv6 address literal. (type: bytes ) |
port | a port number (type: int ) | |
factory | a twisted.internet.protocol.ClientFactory instance (type: ClientFactory ) | |
timeout | number of seconds to wait before assuming the connection has failed. (type: float ) | |
bindAddress | a (host, port) tuple of local address to bind to, or None. (type: Optional[Tuple[str, int]] ) | |
Returns | An 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 ) |