GioUnix.FDMessage¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
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 GioUnix.FDMessage(**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_UNIXfamily). 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.pcpkg-config file or theGioUnix-2.0GIR namespace when using it.- classmethod append_fd(message, fd)¶
- Parameters:
message (
Gio.UnixFDMessage) – aGioUnix.FDMessagefd (
int) – a valid open file descriptor
- Raises:
- Returns:
- Return type:
Adds a file descriptor to message.
The file descriptor is duplicated using dup(). You keep your copy of the descriptor and the copy contained in message will be closed when message is finalized.
A possible cause of failure is exceeding the per-process or system-wide file descriptor limit.
New in version 2.22.
- classmethod get_fd_list(message)¶
- Parameters:
message (
Gio.UnixFDMessage) – aGioUnix.FDMessage- Returns:
the
Gio.UnixFDListfrom message- Return type:
Gets the
Gio.UnixFDListcontained in message. This function does not return a reference to the caller, but the returned list is valid for the lifetime of message.New in version 2.24.
- classmethod new()¶
- Returns:
a new
GioUnix.FDMessage- Return type:
Creates a new
GioUnix.FDMessagecontaining an empty file descriptor list.New in version 2.22.
- classmethod new_with_fd_list(fd_list)¶
- Parameters:
fd_list (
Gio.UnixFDList) – aGio.UnixFDList- Returns:
a new
GioUnix.FDMessage- Return type:
Creates a new
GioUnix.FDMessagecontaining list.New in version 2.24.
- classmethod steal_fds(message)¶
- Parameters:
message (
Gio.UnixFDMessage) – aGioUnix.FDMessage- 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 message. 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-
Nonethen 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 message, an empty array is returned.New in version 2.22.
Property Details¶
- GioUnix.FDMessage.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.