Gio.UnixFDMessage - Classes - Gio 2.0 (original) (raw)
g GObject.Object GObject.Object Gio.SocketControlMessage Gio.SocketControlMessage GObject.Object->Gio.SocketControlMessage Gio.UnixFDMessage Gio.UnixFDMessage Gio.SocketControlMessage->Gio.UnixFDMessage
Subclasses:
None
Methods¶
Inherited:
Gio.SocketControlMessage (5), GObject.Object (37)
Structs:
class | new () |
---|---|
class | new_with_fd_list (fd_list) |
append_fd (fd) | |
get_fd_list () | |
steal_fds () |
Virtual Methods¶
Inherited:
Gio.SocketControlMessage (4), GObject.Object (7)
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
fd-list | Gio.UnixFDList | r/w/co |
Signals¶
Inherited:
Fields¶
Inherited:
Name | Type | Access | Description |
---|---|---|---|
parent_instance | Gio.SocketControlMessage | 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 theG_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 the gio-unix-2.0.pc
pkg-config file or the GioUnix-2.0
GIR namespace when using it.
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) – a Gio.UnixFDList
Returns:
a new Gio.UnixFDMessage
Return type:
Creates a new Gio.UnixFDMessage containing list.
New in version 2.24.
Parameters:
fd (int) – a valid open file descriptor
Raises:
Returns:
True in case of success, else False (and error is set)
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.
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.
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 inself. 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:
READABLE, WRITABLE, CONSTRUCT_ONLY
The [class`Gio`.UnixFDList] object to send with the message.
New in version 2.22.