It derives from <GObject>.
A <GSocketControlMessage> is a
special-purpose utility message that can be sent to or received from a
<GSocket>. 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.send_message and received
with Gio.Socket.receive_message.
To extend the set of control messages 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.Type type system before
calling Gio.Socket.receive_message to read such a message.
parent-instanceprivTries 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 so deserialize it into a
<GSocketControlMessage>.
If there is no implementation for this kind of control message,
#f will be returned.
Passed: a 32-bit integer.
a socket level
Passed: a 32-bit integer.
a socket control message type for the given level
Passed: a bytevector, or a list or vector, each an unsigned 8-bit integer.
pointer to the message data
Returned: a <GSocketControlMessage>,
or #f.
the deserialized message or #f
Not passed: guile-gi gives the length of data.
the size of the data in bytes
Returns the "level" (i.e. the originating protocol) of the control message. This is often SOL_SOCKET.
Passed: a <GSocketControlMessage>.
Returned: a 32-bit integer.
an integer describing the level
Returns the protocol specific type of the control message. For instance, for UNIX fd passing this would be SCM_RIGHTS.
Passed: a <GSocketControlMessage>.
Returned: a 32-bit integer.
an integer describing the type of control message
Returns the space required for the control message, not including headers or alignment.
Passed: a <GSocketControlMessage>.
Returned: an unsigned 64-bit integer.
The number of bytes required.
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 socket-control-message:get-size on this object.
Passed: a <GSocketControlMessage>.
Passed: a foreign pointer, or a bytevector.
A buffer to write data to
Returns the "level" (i.e. the originating protocol) of the control message. This is often SOL_SOCKET.
To override it in a new class, give register-type #:vfuncs
`((get-level . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GSocketControlMessage>, or a class
that derives from it, or its GType number.
Passed: a <GSocketControlMessage>.
Returned: a 32-bit integer.
an integer describing the level
Returns the space required for the control message, not including headers or alignment.
To override it in a new class, give register-type #:vfuncs
`((get-size . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GSocketControlMessage>, or a class
that derives from it, or its GType number.
Passed: a <GSocketControlMessage>.
Returned: an unsigned 64-bit integer.
The number of bytes required.
gets the protocol specific type of the message.
To override it in a new class, give register-type #:vfuncs
`((get-type . ,procedure)). The procedure is called as
(procedure self) ⇒ %return.
Passed: the class whose implementation to call:
<GSocketControlMessage>, or a class
that derives from it, or its GType number.
Passed: a <GSocketControlMessage>.
Returned: a 32-bit integer.
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 socket-control-message:get-size on this object.
To override it in a new class, give register-type #:vfuncs
`((serialize . ,procedure)). The procedure is called as
(procedure self data).
Passed: the class whose implementation to call:
<GSocketControlMessage>, or a class
that derives from it, or its GType number.
Passed: a <GSocketControlMessage>.
Passed: a foreign pointer, or a bytevector.
A buffer to write data to