Package ch.bailu.gtk.gio
Klasse UnixConnection
- Alle implementierten Schnittstellen:
PointerInterface
This is the subclass of [class@Gio.SocketConnection] that is created
for UNIX domain sockets.
It contains functions to do some of the UNIX socket specific
functionality like passing file descriptors.
Since GLib 2.72, `GUnixConnection` is available on all platforms. It requires
underlying system support (such as Windows 10 with `AF_UNIX`) at run time.
Before GLib 2.72, `<gio/gunixconnection.h>` belonged to the UNIX-specific GIO
interfaces, thus you had to use the `gio-unix-2.0.pc` pkg-config file when
using it. This is no longer necessary since GLib 2.72.
for UNIX domain sockets.
It contains functions to do some of the UNIX socket specific
functionality like passing file descriptors.
Since GLib 2.72, `GUnixConnection` is available on all platforms. It requires
underlying system support (such as Windows 10 with `AF_UNIX`) at run time.
Before GLib 2.72, `<gio/gunixconnection.h>` belonged to the UNIX-specific GIO
interfaces, thus you had to use the `gio-unix-2.0.pc` pkg-config file when
using it. This is no longer necessary since GLib 2.72.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenVon Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
receiveCredentials
(Cancellable cancellable) Receives credentials from the sending end of the connection.void
receiveCredentialsAsync
(Cancellable cancellable, UnixConnection.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously receive credentials.receiveCredentialsFinish
(AsyncResult result) Finishes an asynchronous receive credentials operation started with
g_unix_connection_receive_credentials_async().int
receiveFd
(Cancellable cancellable) Receives a file descriptor from the sending end of the connection.boolean
sendCredentials
(Cancellable cancellable) Passes the credentials of the current user the receiving side
of the connection.void
sendCredentialsAsync
(Cancellable cancellable, UnixConnection.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously send credentials.boolean
sendCredentialsFinish
(AsyncResult result) Finishes an asynchronous send credentials operation started with
g_unix_connection_send_credentials_async().boolean
sendFd
(int fd, Cancellable cancellable) Passes a file descriptor to the receiving side of the
connection.Von Klasse geerbte Methoden ch.bailu.gtk.gio.SocketConnection
connect, connectAsync, connectFinish, factoryLookupType, factoryRegisterType, getLocalAddress, getRemoteAddress, getSocket, isConnected
Von Klasse geerbte Methoden ch.bailu.gtk.gio.IOStream
clearPending, close, closeAsync, closeFinish, getInputStream, getOutputStream, hasPending, isClosed, setPending, spliceAsync, spliceFinish
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
UnixConnection
-
-
Methodendetails
-
getClassHandler
-
receiveCredentials
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.- Parameter:
cancellable
- A #GCancellable or %NULL.- Gibt zurück:
- Received credentials on success (free with g_object_unref()), %NULL if @error is set.
- Löst aus:
AllocationError
-
receiveCredentialsAsync
public void receiveCredentialsAsync(@Nullable Cancellable cancellable, UnixConnection.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously receive credentials.
For more details, see g_unix_connection_receive_credentials() which is
the synchronous version of this call.
When the operation is finished, @callback will be called. You can then call
g_unix_connection_receive_credentials_finish() to get the result of the operation.- Parameter:
cancellable
- optional #GCancellable object, %NULL to ignore.callback
- a #GAsyncReadyCallback to call when the request is satisfieduser_data
- the data to pass to callback function
-
receiveCredentialsFinish
Finishes an asynchronous receive credentials operation started with
g_unix_connection_receive_credentials_async().- Parameter:
result
- a #GAsyncResult.- Gibt zurück:
- a #GCredentials, or %NULL on error. Free the returned object with g_object_unref().
- Löst aus:
AllocationError
-
receiveFd
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.- Parameter:
cancellable
- optional #GCancellable object, %NULL to ignore- Gibt zurück:
- a file descriptor on success, -1 on error.
- Löst aus:
AllocationError
-
sendCredentials
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.- Parameter:
cancellable
- A #GCancellable or %NULL.- Gibt zurück:
- %TRUE on success, %FALSE if @error is set.
- Löst aus:
AllocationError
-
sendCredentialsAsync
public void sendCredentialsAsync(@Nullable Cancellable cancellable, UnixConnection.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously send credentials.
For more details, see g_unix_connection_send_credentials() which is
the synchronous version of this call.
When the operation is finished, @callback will be called. You can then call
g_unix_connection_send_credentials_finish() to get the result of the operation.- Parameter:
cancellable
- optional #GCancellable object, %NULL to ignore.callback
- a #GAsyncReadyCallback to call when the request is satisfieduser_data
- the data to pass to callback function
-
sendCredentialsFinish
Finishes an asynchronous send credentials operation started with
g_unix_connection_send_credentials_async().- Parameter:
result
- a #GAsyncResult.- Gibt zurück:
- %TRUE if the operation was successful, otherwise %FALSE.
- Löst aus:
AllocationError
-
sendFd
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.- Parameter:
fd
- a file descriptorcancellable
- optional #GCancellable object, %NULL to ignore.- Gibt zurück:
- a %TRUE on success, %NULL on error.
- Löst aus:
AllocationError
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-