Gio.UnixCredentialsMessage

g GObject.Object GObject.Object Gio.SocketControlMessage Gio.SocketControlMessage GObject.Object->Gio.SocketControlMessage Gio.UnixCredentialsMessage Gio.UnixCredentialsMessage Gio.SocketControlMessage->Gio.UnixCredentialsMessage

Subclasses:

None

Methods

Inherited:

Gio.SocketControlMessage (5), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

is_supported ()

class

new ()

class

new_with_credentials (credentials)

get_credentials ()

Virtual Methods

Inherited:

Gio.SocketControlMessage (4), GObject.Object (7)

Properties

Name

Type

Flags

Short Description

credentials

Gio.Credentials

r/w/co

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gio.SocketControlMessage

r

Class Details

class Gio.UnixCredentialsMessage(**kwargs)
Bases:

Gio.SocketControlMessage

Abstract:

No

Structure:

Gio.UnixCredentialsMessageClass

This [class`Gio`.SocketControlMessage] contains a [class`Gio`.Credentials] instance. It may be sent using [method`Gio`.Socket.send_message] and received using [method`Gio`.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 [method`Gio`.UnixConnection.send_credentials] and [method`Gio`.UnixConnection.receive_credentials]. To receive credentials of a foreign process connected to a socket, use [method`Gio`.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.

New in version 2.26.

classmethod is_supported()[source]
Returns:

True if supported, False otherwise

Return type:

bool

Checks if passing Gio.Credentials on a Gio.Socket is supported on this platform.

New in version 2.26.

classmethod new()[source]
Returns:

a new Gio.UnixCredentialsMessage

Return type:

Gio.SocketControlMessage

Creates a new Gio.UnixCredentialsMessage with credentials matching the current processes.

New in version 2.26.

classmethod new_with_credentials(credentials)[source]
Parameters:

credentials (Gio.Credentials) – A Gio.Credentials object.

Returns:

a new Gio.UnixCredentialsMessage

Return type:

Gio.SocketControlMessage

Creates a new Gio.UnixCredentialsMessage holding credentials.

New in version 2.26.

get_credentials()[source]
Returns:

A Gio.Credentials instance. Do not free, it is owned by self.

Return type:

Gio.Credentials

Gets the credentials stored in self.

New in version 2.26.

Property Details

Gio.UnixCredentialsMessage.props.credentials
Name:

credentials

Type:

Gio.Credentials

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The credentials stored in the message.

New in version 2.26.