Class: Gio::UnixFDMessage
- Inherits:
-
Object
- Object
- Gio::UnixFDMessage
- Defined in:
- (unknown)
Instance Method Summary collapse
-
#append_fd(fd) ⇒ TrueClass
Adds a file descriptor to message.
-
#fd_list ⇒ Gio::UnixFDList
Fd-list.
- #fd_list=(fd_list) ⇒ Gio::UnixFDList
-
#new ⇒ Gio::SocketControlMessage
Creates a new GUnix::FDMessage containing an empty file descriptor list.
-
#new_with_fd_list(fd_list) ⇒ Gio::SocketControlMessage
Creates a new GUnix::FDMessage containing list.
-
#steal_fds(length) ⇒ Array<Integer>
Returns the array of file descriptors that is contained in this object.
Instance Method Details
#append_fd(fd) ⇒ TrueClass
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
Returns fd-list.
#fd_list=(fd_list) ⇒ Gio::UnixFDList
#new ⇒ Gio::SocketControlMessage
Creates a new GUnix::FDMessage containing an empty file descriptor list.
#new_with_fd_list(fd_list) ⇒ Gio::SocketControlMessage
Creates a new GUnix::FDMessage containing list.
#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.