SocketConnection


Object Hierarchy:

GLib.SocketConnection GLib.SocketConnection GLib.SocketConnection GLib.IOStream GLib.IOStream GLib.IOStream->GLib.SocketConnection GLib.Object GLib.Object GLib.Object->GLib.IOStream

Description:

[ CCode ( type_id = "g_socket_connection_get_type ()" ) ]
[ Version ( since = "2.22" ) ]
public class SocketConnection : IOStream

`GSocketConnection` is a [class@Gio.

IOStream] for a connected socket. They can be created either by [class@Gio.SocketClient] when connecting to a host, or by [ class@Gio.SocketListener] when accepting a new client.

The type of the `GSocketConnection` object returned from these calls depends on the type of the underlying socket that is in use. For instance, for a TCP/IP connection it will be a [class@Gio.TcpConnection].

Choosing what type of object to construct is done with the socket connection factory, and it is possible for third parties to register custom socket connection types for specific combination of socket family/type/protocol using [func@Gio.SocketConnection.factory_register_type].

To close a `GSocketConnection`, use [method@Gio.IOStream.close]. Closing both substreams of the [class@Gio.IOStream] separately will not close the underlying [class@Gio.Socket].

All known sub-classes:

Namespace: GLib
Package: gio-2.0

Content:

Properties:

Static methods:

Creation methods:

Methods:

Inherited Members: