Package org.gnome.gio

Class SocketConnection

java.lang.Object
All Implemented Interfaces:
Proxy, AutoCloseable, AutoCloseable
Direct Known Subclasses:
TcpConnection, UnixConnection

@Generated("io.github.jwharm.JavaGI") public class SocketConnection extends IOStream
GSocketConnection is a IOStream for a connected socket. They can be created either by SocketClient when connecting to a host, or by 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 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 factoryRegisterType(org.gnome.glib.Type, org.gnome.gio.SocketFamily, org.gnome.gio.SocketType, int).

To close a GSocketConnection, use IOStream.close(org.gnome.gio.Cancellable). Closing both substreams of the IOStream separately will not close the underlying Socket.