Class: Gio::UnixFDMessage

Inherits:
SocketControlMessage show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from SocketControlMessage

deserialize, #level, #msg_type, #serialize, #size

Constructor Details

#initialize(fd_list) ⇒ Gio::SocketControlMessage

Creates a new GUnix::FDMessage containing list.

Parameters:

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.

Parameters:

  • fd (Integer)

    a valid open file descriptor

Returns:

  • (Boolean)

    true in case of success, else false (and error is set)

#fd_listGio::UnixFDList

The [classGio.UnixFDList] object to send with the message.

Returns:

#fd_list=(fd_list) ⇒ Gio::UnixFDList

The [classGio.UnixFDList] object to send with the message.

Parameters:

Returns:

#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.

Parameters:

  • length (Integer)

    pointer to the length of the returned
    array, or nil

Returns:

  • (Array<Integer>)

    an array of file
    descriptors