gio.socket_control_message

Module for [SocketControlMessage] class

Types 3

A [gio.socket_control_message.SocketControlMessage] is a special-purpose utility message that can be sent to or received from a [gio.socket.Socket]. These types of messages are often called ‘ancillary data’.

The message can represent some sort of special instruction to or information from the socket or can represent a special kind of transfer to the peer (for example, sending a file descriptor over a UNIX socket).

These messages are sent with [gio.socket.Socket.sendMessage] and received with [gio.socket.Socket.receiveMessage].

To extend the set of control message that can be sent, subclass this class and override the get_size, get_level, get_type and serialize methods.

To extend the set of control messages that can be received, subclass this class and implement the deserialize method. Also, make sure your class is registered with the [gobject.types.size_t] type system before calling [gio.socket.Socket.receiveMessage] to read such a message.

Methods
GType _gType() @property
SocketControlMessage self()Returns `this`, for use in `with` statements.
SocketControlMessageGidBuilder builder()Get builder for [gio.socketcontrolmessage.SocketControlMessage] Returns: New builder object
gio.socket_control_message.SocketControlMessage deserialize(int level, int type, ubyte[] data)Tries to deserialize a socket control message of a given level and type. This will ask all known (to GType) subclasses of #GSocketControlMessage if they can understand this kind of message and if s...
int getLevel()Returns the "level" (i.e. the originating protocol) of the control message. This is often SOL_SOCKET. Returns: an integer describing the level
int getMsgType()Returns the protocol specific type of the control message. For instance, for UNIX fd passing this would be SCM_RIGHTS. Returns: an integer describing the type of control message
size_t getSize()Returns the space required for the control message, not including headers or alignment. Returns: The number of bytes required.
void serialize(void * data)Converts the data in the message to bytes placed in the message.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder for [gio.socket_control_message.SocketControlMessage]