package ocgtk

  1. Overview
  2. Docs
OCaml bindings for GTK 4

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.1-preview2.tar.gz
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054

doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/Socket_connection/index.html

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.