class documentation

class Port(_SocketCloser, _LogOwner): (source)

Implements interfaces: twisted.internet.interfaces.IListeningPort

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method __repr__ Undocumented
Method cb​Accept Undocumented
Method connection​Lost Cleans up the socket.
Method do​Accept Undocumented
Method get​Host Returns an IPv4Address or IPv6Address.
Method handle​Accept Undocumented
Method log​Prefix Returns the name of my class, to prefix log entries with.
Method lose​Connection Stop accepting connections on this port.
Method start​Listening Start listening on this port.
Class Variable sessionno Undocumented
Instance Variable address​Family Undocumented
Instance Variable addr​Len Undocumented
Instance Variable backlog Undocumented
Instance Variable connected Undocumented
Instance Variable deferred Undocumented
Instance Variable disconnected Undocumented
Instance Variable disconnecting Undocumented
Instance Variable factory Undocumented
Instance Variable get​File​Handle Undocumented
Instance Variable interface Undocumented
Instance Variable port Undocumented
Instance Variable reactor Undocumented
Instance Variable socket Undocumented
Method _log​Connection​Lost​Msg Log message for closing port
Class Variable _type Undocumented
Instance Variable _address​Type Undocumented
Instance Variable _real​Port​Number Undocumented

Inherited from _SocketCloser:

Method _close​Socket Undocumented
Instance Variable _should​Shutdown Set to True if shutdown should be called before calling close on the underlying socket.

Inherited from _LogOwner:

Method _get​Log​Prefix Determine the log prefix to use for messages related to applicationObject, which may or may not be an interfaces.ILoggingContext provider.
def __init__(self, port, factory, backlog=50, interface='', reactor=None): (source)

Undocumented

def __repr__(self): (source)

Undocumented

Returns
strUndocumented
def cbAccept(self, rc, data, evt): (source)

Undocumented

def connectionLost(self, reason): (source)
Cleans up the socket.
def doAccept(self): (source)

Undocumented

def getHost(self): (source)

Returns an IPv4Address or IPv6Address.

This indicates the server's address.

def handleAccept(self, rc, evt): (source)

Undocumented

def logPrefix(self): (source)
Returns the name of my class, to prefix log entries with.
def loseConnection(self, connDone=failure.Failure(main.CONNECTION_DONE)): (source)

Stop accepting connections on this port.

This will shut down my socket and call self.connectionLost(). It returns a deferred which will fire successfully when the port is actually closed.

def startListening(self): (source)
Start listening on this port.
Raises
CannotListenErrorIf it cannot listen on this port (e.g., it is a TCP port and it cannot bind to the required port number).
sessionno: int = (source)

Undocumented

addressFamily = (source)

Undocumented

addrLen = (source)

Undocumented

backlog = (source)

Undocumented

connected: bool = (source)

Undocumented

deferred = (source)

Undocumented

disconnected: bool = (source)

Undocumented

disconnecting: bool = (source)

Undocumented

factory = (source)

Undocumented

getFileHandle = (source)

Undocumented

interface = (source)

Undocumented

port = (source)

Undocumented

reactor = (source)

Undocumented

socket = (source)

Undocumented

def _logConnectionLostMsg(self): (source)
Log message for closing port
_type: str = (source)

Undocumented

_addressType = (source)

Undocumented

_realPortNumber = (source)

Undocumented