module documentation
(source)

Various asynchronous TCP/IP classes.

End users shouldn't use this module directly - use the reactor APIs instead.

Variable EPERM Undocumented
Variable ENFILE Undocumented
Variable ENOMEM Undocumented
Class Connection Superclass of all socket-based FileDescriptors.
Class BaseClient A base class for client TCP (and similar) sockets.
Class Client A transport for a TCP protocol; either TCPv4 or TCPv6.
Class Server Serverside socket-stream connection class.
Class Port A TCP server port, listening for connections.
Class Connector A Connector provides of twisted.internet.interfaces.IConnector for all POSIX-style reactors.
Class _TLSConnectionMixin Undocumented
Class _TLSClientMixin Undocumented
Class _TLSServerMixin Undocumented
Variable _AI_NUMERICSERV Undocumented
Function _getrealname No summary
Function _getpeername See _getrealname.
Function _getsockname See _getrealname.
Class _SocketCloser
Class _AbortingMixin Common implementation of abortConnection.
Class _BaseBaseClient Code shared with other (non-POSIX) reactors for management of general outgoing connections.
Variable _NUMERIC_ONLY Undocumented
Function _resolveIPv6 Resolve an IPv6 literal into an IPv6 address.
Class _BaseTCPClient Code shared with other (non-POSIX) reactors for management of outgoing TCP connections (both TCPv4 and TCPv6).
Interface _IFileDescriptorReservation No summary
Class _FileDescriptorReservation _IFileDescriptorReservation implementation.
Class _NullFileDescriptorReservation A null implementation of _IFileDescriptorReservation.
Variable _reservedFD Undocumented
Variable _ACCEPT_ERRORS Undocumented
Class _BuffersLogs A context manager that buffers any log events until after its block exits.
Function _accept Return a generator that yields client sockets from the provided listening socket until there are none left or an unrecoverable error occurs.
EPERM = (source)

Undocumented

ENFILE = (source)

Undocumented

ENOMEM = (source)

Undocumented

_AI_NUMERICSERV = (source)

Undocumented

def _getrealname(addr): (source)

Return a 2-tuple of socket IP and port for IPv4 and a 4-tuple of socket IP, port, flowInfo, and scopeID for IPv6. For IPv6, it returns the interface portion (the part after the %) as a part of the IPv6 address, which Python 3.7+ does not include.

ParametersaddrA 2-tuple for IPv4 information or a 4-tuple for IPv6 information.
def _getpeername(skt): (source)
def _getsockname(skt): (source)
_NUMERIC_ONLY = (source)

Undocumented

def _resolveIPv6(ip, port): (source)

Resolve an IPv6 literal into an IPv6 address.

This is necessary to resolve any embedded scope identifiers to the relevant sin6_scope_id for use with socket.connect(), socket.listen(), or socket.bind(); see RFC 3493 for more information.

ParametersipAn IPv6 address literal. (type: str)
portA port number. (type: int)
Returnsa 4-tuple of (host, port, flow, scope), suitable for use as an IPv6 address.
Raisessocket.gaierrorif either the IP or port is not numeric as it should be.
_reservedFD = (source)

Undocumented

_ACCEPT_ERRORS = (source)

Undocumented

def _accept(logger, accepts, listener, reservedFD): (source)

Return a generator that yields client sockets from the provided listening socket until there are none left or an unrecoverable error occurs.

ParametersloggerA logger to which accept-related events will be logged. This should not log to arbitrary observers that might open a file descriptor to avoid claiming the EMFILE file descriptor on UNIX-like systems. (type: Logger)
acceptsAn iterable iterated over to limit the number consecutive accepts. (type: An iterable.)
listenerThe listening socket. (type: socket.socket)
reservedFDA reserved file descriptor that can be used to recover from EMFILE on UNIX-like systems. (type: _IFileDescriptorReservation)
ReturnsA generator that yields (socket, addr) tuples from socket.socket.accept
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.