Gio.UnixConnection¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gio.SocketConnection (9), Gio.IOStream (11), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| receive_credentials(cancellable) | |
| receive_credentials_async(cancellable, callback, *user_data) | |
| receive_credentials_finish(result) | |
| receive_fd(cancellable) | |
| send_credentials(cancellable) | |
| send_credentials_async(cancellable, callback, *user_data) | |
| send_credentials_finish(result) | |
| send_fd(fd, cancellable) | 
Virtual Methods¶
| Inherited: | Gio.IOStream (5), GObject.Object (7) | 
|---|
Properties¶
| Inherited: | Gio.SocketConnection (1), Gio.IOStream (3) | 
|---|
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent_instance | Gio.SocketConnection | r | 
Class Details¶
- 
class Gio.UnixConnection(**kwargs)¶
- Bases: - Gio.SocketConnection- Abstract: - No - Structure: - Gio.UnixConnectionClass- This is the subclass of - Gio.SocketConnectionthat is created for UNIX domain sockets.- It contains functions to do some of the UNIX socket specific functionality like passing file descriptors. - Note that - <gio/gunixconnection.h>belongs to the UNIX-specific GIO interfaces, thus you have to use the- gio-unix-2.0.pcpkg-config file when using it.- New in version 2.22. - 
receive_credentials(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – A- Gio.Cancellableor- None.- Raises: - GLib.Error- Returns: - Received credentials on success (free with - GObject.Object.unref()),- Noneif error is set.- Return type: - Gio.Credentials- Receives credentials from the sending end of the connection. The sending end has to call - Gio.UnixConnection.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 - Gio.UnixCredentialsMessagetype and- Gio.Socket.get_credentials() function.- New in version 2.26. 
 - 
receive_credentials_async(cancellable, callback, *user_data)[source]¶
- Parameters: - cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – the data to pass to callback function
 - Asynchronously receive credentials. - For more details, see - Gio.UnixConnection.receive_credentials() which is the synchronous version of this call.- When the operation is finished, callback will be called. You can then call - Gio.UnixConnection.receive_credentials_finish() to get the result of the operation.- New in version 2.32. 
- cancellable (
 - 
receive_credentials_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult.- Raises: - GLib.Error- Returns: - a - Gio.Credentials, or- Noneon error. Free the returned object with- GObject.Object.unref().- Return type: - Gio.Credentials- Finishes an asynchronous receive credentials operation started with - Gio.UnixConnection.receive_credentials_async().- New in version 2.32. 
 - 
receive_fd(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject,- Noneto ignore- Raises: - GLib.Error- Returns: - a file descriptor on success, -1 on error. - Return type: - int- Receives a file descriptor from the sending end of the connection. The sending end has to call - Gio.UnixConnection.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. - New in version 2.22. 
 - 
send_credentials(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – A- Gio.Cancellableor- None.- Raises: - GLib.Error- Returns: - Trueon success,- Falseif error is set.- Return type: - bool- Passes the credentials of the current user the receiving side of the connection. The receiving end has to call - Gio.UnixConnection.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 - Gio.UnixCredentialsMessagetype and- Gio.Socket.get_credentials() function.- New in version 2.26. 
 - 
send_credentials_async(cancellable, callback, *user_data)[source]¶
- Parameters: - cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – the data to pass to callback function
 - Asynchronously send credentials. - For more details, see - Gio.UnixConnection.send_credentials() which is the synchronous version of this call.- When the operation is finished, callback will be called. You can then call - Gio.UnixConnection.send_credentials_finish() to get the result of the operation.- New in version 2.32. 
- cancellable (
 - 
send_credentials_finish(result)[source]¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult.- Raises: - GLib.Error- Returns: - Trueif the operation was successful, otherwise- False.- Return type: - bool- Finishes an asynchronous send credentials operation started with - Gio.UnixConnection.send_credentials_async().- New in version 2.32. 
 - 
send_fd(fd, cancellable)[source]¶
- Parameters: - fd (int) – a file descriptor
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject,Noneto ignore.
 - Raises: - Returns: - Return type: - Passes a file descriptor to the receiving side of the connection. The receiving end has to call - Gio.UnixConnection.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. - New in version 2.22. 
- fd (
 
-