TcpConnection

Added in version 2.22.

class TcpConnection(**properties: Any)

Superclasses: SocketConnection, IOStream, Object

Subclasses: TcpWrapperConnection

This is the subclass of SocketConnection that is created for TCP/IP sockets.

Methods

class TcpConnection
get_graceful_disconnect() bool

Checks if graceful disconnects are used. See set_graceful_disconnect().

Added in version 2.22.

set_graceful_disconnect(graceful_disconnect: bool) None

This enables graceful disconnects on close. A graceful disconnect means that we signal the receiving end that the connection is terminated and wait for it to close the connection before closing the connection.

A graceful disconnect means that we can be sure that we successfully sent all the outstanding data to the other end, or get an error reported. However, it also means we have to wait for all the data to reach the other side and for it to acknowledge this by closing the socket, which may take a while. For this reason it is disabled by default.

Added in version 2.22.

Parameters:

graceful_disconnect – Whether to do graceful disconnects or not

Properties

class TcpConnection
props.graceful_disconnect: bool

Whether close does a graceful disconnect.

Added in version 2.22.

Fields

class TcpConnection
parent_instance
priv