interface documentation

class ITCPTransport(ITransport): (source)

Known subclasses: twisted.internet.interfaces.ISSLTransport, twisted.internet.interfaces.ITLSTransport

Known implementations: twisted.internet.iocpreactor.tcp.Connection, twisted.internet.tcp.Connection

View In Hierarchy

A TCP based transport.
Method abort​Connection Close the connection abruptly.
Method get​Host Returns IPv4Address or IPv6Address.
Method get​Peer Returns IPv4Address or IPv6Address.
Method get​Tcp​Keep​Alive Return if SO_KEEPALIVE is enabled.
Method get​Tcp​No​Delay Return if TCP_NODELAY is enabled.
Method lose​Write​Connection Half-close the write side of a TCP connection.
Method set​Tcp​Keep​Alive Enable/disable SO_KEEPALIVE.
Method set​Tcp​No​Delay Enable/disable TCP_NODELAY.

Inherited from ITransport:

Method lose​Connection Close my connection, after writing all pending data.
Method write Write some data to the physical connection, in sequence, in a non-blocking fashion.
Method write​Sequence Write an iterable of byte strings to the physical connection.
def abortConnection(): (source)

Close the connection abruptly.

Discards any buffered data, stops any registered producer, and, if possible, notifies the other end of the unclean closure.

Present Since
11.1
def getTcpKeepAlive(): (source)
Return if SO_KEEPALIVE is enabled.
Returns
boolUndocumented
def getTcpNoDelay(): (source)
Return if TCP_NODELAY is enabled.
Returns
boolUndocumented
def loseWriteConnection(): (source)

Half-close the write side of a TCP connection.

If the protocol instance this is attached to provides IHalfCloseableProtocol, it will get notified when the operation is done. When closing write connection, as with loseConnection this will only happen when buffer has emptied and there is no registered producer.

def setTcpKeepAlive(enabled): (source)

Enable/disable SO_KEEPALIVE.

Enabling SO_KEEPALIVE sends packets periodically when the connection is otherwise idle, usually once every two hours. They are intended to allow detection of lost peers in a non-infinite amount of time.

Parameters
enabled:boolUndocumented
def setTcpNoDelay(enabled): (source)

Enable/disable TCP_NODELAY.

Enabling TCP_NODELAY turns off Nagle's algorithm. Small packets are sent sooner, possibly at the expense of overall throughput.

Parameters
enabled:boolUndocumented