Class: Gio::SocketControlMessage

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

Overview

Class structure for GSocket::ControlMessage.

Direct Known Subclasses

UnixCredentialsMessage, UnixFDMessage

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.deserialize(level, type, size, data) ⇒ Gio::SocketControlMessage

Tries to deserialize a socket control message of a given level and type. This will ask all known (to GType) subclasses of GSocket::ControlMessage if they can understand this kind of message and if so deserialize it into a GSocket::ControlMessage.

If there is no implementation for this kind of control message, nil will be returned.

Parameters:

  • level (Integer)

    a socket level

  • type (Integer)

    a socket control message type for the given level

  • size (Integer)

    the size of the data in bytes

  • data (Array<Integer>)

    pointer to the message data

Returns:

Instance Method Details

#levelInteger

Returns the "level" (i.e. the originating protocol) of the control message. This is often SOL_SOCKET.

Returns:

  • (Integer)

    an integer describing the level

#msg_typeInteger

Returns the protocol specific type of the control message. For instance, for UNIX fd passing this would be SCM_RIGHTS.

Returns:

  • (Integer)

    an integer describing the type of control message

#serialize(data) ⇒ nil

Converts the data in the message to bytes placed in the message.

data is guaranteed to have enough space to fit the size returned by g_socket_control_message_get_size() on this object.

Parameters:

  • data (GObject)

    A buffer to write data to

Returns:

  • (nil)

#sizeInteger

Returns the space required for the control message, not including headers or alignment.

Returns:

  • (Integer)

    The number of bytes required.