Class UnixCredentialsMessage

All Implemented Interfaces:
PointerInterface

public class UnixCredentialsMessage extends SocketControlMessage
This #GSocketControlMessage contains a #GCredentials instance. It
may be sent using g_socket_send_message() and received using
g_socket_receive_message() over UNIX sockets (ie: sockets in the
%G_SOCKET_FAMILY_UNIX family).

For an easier way to send and receive credentials over
stream-oriented UNIX sockets, see
g_unix_connection_send_credentials() and
g_unix_connection_receive_credentials(). To receive credentials of
a foreign process connected to a socket, use
g_socket_get_credentials().

Since GLib 2.72, #GUnixCredentialMessage 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/gunixcredentialsmessage.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.

https://docs.gtk.org/gio/class.UnixCredentialsMessage.html

  • Constructor Details

    • UnixCredentialsMessage

      public UnixCredentialsMessage(PointerContainer pointer)
    • UnixCredentialsMessage

      public UnixCredentialsMessage()
      Creates a new #GUnixCredentialsMessage with credentials matching the current processes.
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newWithCredentialsUnixCredentialsMessage

      public static UnixCredentialsMessage newWithCredentialsUnixCredentialsMessage(@Nonnull Credentials credentials)
      Creates a new #GUnixCredentialsMessage holding @credentials.
      Parameters:
      credentials - A #GCredentials object.
      Returns:
      a new #GUnixCredentialsMessage
    • getCredentials

      public Credentials getCredentials()
      Gets the credentials stored in @message.
      Returns:
      A #GCredentials instance. Do not free, it is owned by @message.
    • isSupported

      public static boolean isSupported()
      Checks if passing #GCredentials on a #GSocket is supported on this platform.
      Returns:
      %TRUE if supported, %FALSE otherwise
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()