Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

GLib::UnixFDMessage

class GLib::UnixFDMessage

This GLib::SocketControlMessage contains a GLib::UnixFDList?. It may be sent using GLib::Socket#send_message and received using GLib::Socket#receive_message over Unix sockets (that is, sockets in the GLib::Socket::ADDRESS_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 GLib::UnixConnection#send_fd and GLib::UnixConnection#receive_fd.

Note that GLib::UnixFDMessage belongs to the Unix-specific GIO interfaces.

Instance Methods

<<(fd)
Same as GLib::UnixFDMessage#append_fd.
append_fd(fd)

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.

A GLib::IO::Error is raised if the file descriptor can’t be duplicated.

  • Returns: self
fd_list
Gets the GLib::UnixFDList? object to send with the message.
  • Returns: The GLib::UnixFDList? object to send with the message
steal_fds

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 Array (unless more descriptors have been added).

The caller is responsible for closing all of the file descriptors.

  • Returns: An Array of file descriptors

Properties

fd-list: GLib::UnixFDList (Read/Write)
The GLib::UnixFDList? object to send with the message
Last modified:2010/12/27 21:59:23
Keyword(s):
References:[GLib::UnixFDMessage] [index-ruby-gio2] [Ruby/GIO] [index-ruby-glib2]