Gio.TcpConnection

g GObject.Object GObject.Object Gio.IOStream Gio.IOStream GObject.Object->Gio.IOStream Gio.SocketConnection Gio.SocketConnection Gio.IOStream->Gio.SocketConnection Gio.TcpConnection Gio.TcpConnection Gio.SocketConnection->Gio.TcpConnection

Subclasses:

Gio.TcpWrapperConnection

Methods

Inherited:

Gio.SocketConnection (9), Gio.IOStream (11), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_graceful_disconnect ()

set_graceful_disconnect (graceful_disconnect)

Virtual Methods

Inherited:

Gio.IOStream (5), GObject.Object (7)

Properties

Inherited:

Gio.SocketConnection (1), Gio.IOStream (3)

Name

Type

Flags

Short Description

graceful-disconnect

bool

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gio.SocketConnection

r

Class Details

class Gio.TcpConnection(**kwargs)
Bases:

Gio.SocketConnection

Abstract:

No

Structure:

Gio.TcpConnectionClass

This is the subclass of [class`Gio`.SocketConnection] that is created for TCP/IP sockets.

New in version 2.22.

get_graceful_disconnect()[source]
Returns:

True if graceful disconnect is used on close, False otherwise

Return type:

bool

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

New in version 2.22.

set_graceful_disconnect(graceful_disconnect)[source]
Parameters:

graceful_disconnect (bool) – Whether to do graceful disconnects or not

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.

New in version 2.22.

Property Details

Gio.TcpConnection.props.graceful_disconnect
Name:

graceful-disconnect

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether [method`Gio`.IOStream.close] does a graceful disconnect.

New in version 2.22.