Class: Gio::UnixFDMessage

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

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.

Parameters:

  • fd (Integer)

    a valid open file descriptor

Returns:

  • (TrueClass)

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

#fd_listGio::UnixFDList

Returns fd-list.

Returns:

#fd_list=(fd_list) ⇒ Gio::UnixFDList

Parameters:

Returns:

#newGio::SocketControlMessage

Creates a new GUnix::FDMessage containing an empty file descriptor list.

Returns:

#new_with_fd_list(fd_list) ⇒ Gio::SocketControlMessage

Creates a new GUnix::FDMessage containing list.

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