package ocgtk

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

Module Wrappers.Unix_connection

type t = [ `unix_connection | `socket_connection | `io_stream | `object_ ] Gobject.obj
val send_fd : t -> int -> [ `cancellable | `object_ ] Gobject.obj option -> (bool, GError.t) result

Passes a file descriptor to the receiving side of the connection. The receiving end has to call g_unix_connection_receive_fd() to accept the file descriptor.

As well as sending the fd this also writes a single byte to the stream, as this is required for fd passing to work on some implementations.

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

Finishes an asynchronous send credentials operation started with g_unix_connection_send_credentials_async().

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

Passes the credentials of the current user the receiving side of the connection. The receiving end has to call g_unix_connection_receive_credentials() (or similar) to accept the credentials.

As well as sending the credentials this also writes a single NUL byte to the stream, as this is required for credentials passing to work on some implementations.

This method can be expected to be available on the following platforms:

  • Linux since GLib 2.26
  • FreeBSD since GLib 2.26
  • GNU/kFreeBSD since GLib 2.36
  • Solaris, Illumos and OpenSolaris since GLib 2.40
  • GNU/Hurd since GLib 2.40

Other ways to exchange credentials with a foreign peer includes the #GUnixCredentialsMessage type and g_socket_get_credentials() function.

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

Receives a file descriptor from the sending end of the connection. The sending end has to call g_unix_connection_send_fd() for this to work.

As well as reading the fd this also reads a single byte from the stream, as this is required for fd passing to work on some implementations.

val receive_credentials_finish : t -> [ `async_result ] Gobject.obj -> ([ `credentials | `object_ ] Gobject.obj, GError.t) result

Finishes an asynchronous receive credentials operation started with g_unix_connection_receive_credentials_async().

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

Receives credentials from the sending end of the connection. The sending end has to call g_unix_connection_send_credentials() (or similar) for this to work.

As well as reading the credentials this also reads (and discards) a single byte from the stream, as this is required for credentials passing to work on some implementations.

This method can be expected to be available on the following platforms:

  • Linux since GLib 2.26
  • FreeBSD since GLib 2.26
  • GNU/kFreeBSD since GLib 2.36
  • Solaris, Illumos and OpenSolaris since GLib 2.40
  • GNU/Hurd since GLib 2.40

Other ways to exchange credentials with a foreign peer includes the #GUnixCredentialsMessage type and g_socket_get_credentials() function.