Class: Gio::UnixFDMessage
- Inherits:
-
SocketControlMessage
- Object
- SocketControlMessage
- Gio::UnixFDMessage
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#append_fd(fd) ⇒ Boolean
Adds a file descriptor to message.
-
#fd_list ⇒ Gio::UnixFDList
The [classGio.UnixFDList] object to send with the message.
-
#fd_list=(fd_list) ⇒ Gio::UnixFDList
The [classGio.UnixFDList] object to send with the message.
-
#initialize(fd_list) ⇒ Gio::SocketControlMessage
constructor
Creates a new GUnix::FDMessage containing list.
-
#steal_fds(length) ⇒ Array<Integer>
Returns the array of file descriptors that is contained in this object.
Methods inherited from SocketControlMessage
deserialize, #level, #msg_type, #serialize, #size
Constructor Details
#initialize(fd_list) ⇒ Gio::SocketControlMessage
Creates a new GUnix::FDMessage containing list.
Instance Method Details
#append_fd(fd) ⇒ Boolean
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.
#fd_list ⇒ Gio::UnixFDList
The [classGio.UnixFDList] object to send with the message.
#fd_list=(fd_list) ⇒ Gio::UnixFDList
The [classGio.UnixFDList] object to send with the message.
#steal_fds(length) ⇒ Array<Integer>
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 g_free(). The caller is also responsible for closing all of the file descriptors.
If length is non-nil 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 nil. In case there are no file descriptors contained in message, an empty array is returned.