Gio.UnixFDMessage¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gio.UnixFDMessage(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
This [class`Gio`.SocketControlMessage] contains a [class`Gio`.UnixFDList]. 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). The file descriptors are copied between processes by the kernel.For an easier way to send and receive file descriptors over stream-oriented UNIX sockets, see [method`Gio`.UnixConnection.send_fd] and [method`Gio`.UnixConnection.receive_fd].
Note that
<gio/gunixfdmessage.h>
belongs to the UNIX-specific GIO interfaces, thus you have to use thegio-unix-2.0.pc
pkg-config file or theGioUnix-2.0
GIR namespace when using it.- classmethod new()[source]¶
- Returns:
a new
Gio.UnixFDMessage
- Return type:
Creates a new
Gio.UnixFDMessage
containing an empty file descriptor list.New in version 2.22.
- classmethod new_with_fd_list(fd_list)[source]¶
- Parameters:
fd_list (
Gio.UnixFDList
) – aGio.UnixFDList
- Returns:
a new
Gio.UnixFDMessage
- Return type:
Creates a new
Gio.UnixFDMessage
containing list.New in version 2.24.
- append_fd(fd)[source]¶
- Parameters:
fd (
int
) – a valid open file descriptor- Raises:
- Returns:
- Return type:
Adds a file descriptor to self.
The file descriptor is duplicated using dup(). You keep your copy of the descriptor and the copy contained in self will be closed when self is finalized.
A possible cause of failure is exceeding the per-process or system-wide file descriptor limit.
New in version 2.22.
- get_fd_list()[source]¶
- Returns:
the
Gio.UnixFDList
from self- Return type:
Gets the
Gio.UnixFDList
contained in self. This function does not return a reference to the caller, but the returned list is valid for the lifetime of self.New in version 2.24.
- steal_fds()[source]¶
- Returns:
an array of file descriptors
- Return type:
[
int
]
Returns the array of file descriptors that is contained in this object.
After this call, the descriptors are no longer contained in self. Further calls will return an empty list (unless more descriptors have been added).
The return result of this function must be freed with
GLib.free
(). The caller is also responsible for closing all of the file descriptors.If length is non-
None
then it is set to the number of file descriptors in the returned array. The returned array is also terminated with -1.This function never returns
None
. In case there are no file descriptors contained in self, an empty array is returned.New in version 2.22.
Property Details¶
- Gio.UnixFDMessage.props.fd_list¶
- Name:
fd-list
- Type:
- Default Value:
- Flags:
The [class`Gio`.UnixFDList] object to send with the message.
New in version 2.22.