package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gio/Ocgtk_gio/Gio/Wrappers/Unix_connection/index.html
Module Wrappers.Unix_connection
type t =
[ `unix_connection | `socket_connection | `io_stream | `object_ ] Gobject.objval send_fd :
t ->
int ->
[ `cancellable | `object_ ] Gobject.obj option ->
(bool, GError.t) resultPasses 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) resultFinishes 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) resultPasses 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) resultReceives 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) resultFinishes 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) resultReceives 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.