package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Socket_connection

type t = [ `socket_connection | `io_stream | `object_ ] Gobject.obj
val is_connected : t -> bool

Checks if @connection is connected. This is equivalent to calling g_socket_is_connected() on @connection's underlying #GSocket.

val get_socket : t -> [ `socket | `object_ ] Gobject.obj

Gets the underlying #GSocket object of the connection. This can be useful if you want to do something unusual on it not supported by the #GSocketConnection APIs.

val get_remote_address : t -> ([ `socket_address | `object_ ] Gobject.obj, GError.t) result

Try to get the remote address of a socket connection.

Since GLib 2.40, when used with g_socket_client_connect() or g_socket_client_connect_async(), during emission of %G_SOCKET_CLIENT_CONNECTING, this function will return the remote address that will be used for the connection. This allows applications to print e.g. "Connecting to example.com (10.42.77.3)...".

val get_local_address : t -> ([ `socket_address | `object_ ] Gobject.obj, GError.t) result

Try to get the local address of a socket connection.

val connect_finish : t -> [ `async_result ] Gobject.obj -> (bool, GError.t) result

Gets the result of a g_socket_connection_connect_async() call.

val connect : t -> [ `socket_address | `object_ ] Gobject.obj -> [ `cancellable | `object_ ] Gobject.obj option -> (bool, GError.t) result

Connect @connection to the specified remote address.