class Gio::InputMessage

Overview

Structure used for scatter/gather data input when receiving multiple messages or packets in one go. You generally pass in an array of empty #GInputVectors and the operation will use all the buffers as if they were one buffer, and will set bytes_received to the total number of bytes received across all #GInputVectors.

This structure closely mirrors struct mmsghdr and struct msghdr from the POSIX sockets API (see man 2 recvmmsg).

If address is non-nil then it is set to the source address the message was received from, and the caller must free it afterwards.

If control_messages is non-nil then it is set to an array of control messages received with the message (if any), and the caller must free it afterwards. num_control_messages is set to the number of elements in this array, which may be zero.

Flags relevant to this message will be returned in flags. For example, MSG_EOR or MSG_TRUNC.

Defined in:

lib/gi-crystal/src/auto/gio-2.0/input_message.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pointer : Pointer(Void), transfer : GICrystal::Transfer) #

[View source]
def self.new(data : LibGio::InputMessage, transfer : GICrystal::Transfer) #

[View source]
def self.new(num_vectors : UInt32 | Nil = nil, bytes_received : UInt64 | Nil = nil, flags : Int32 | Nil = nil) #

[View source]

Instance Method Detail

def ==(other : self) : Bool #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def address : Gio::SocketAddress | Nil #

[View source]
def address! #

[View source]
def bytes_received : UInt64 #

[View source]
def bytes_received=(value : UInt64) #

[View source]
def control_messages : Enumerable(Gio::SocketControlMessage) | Nil #

[View source]
def control_messages! #

[View source]
def flags : Int32 #

[View source]
def flags=(value : Int32) #

[View source]
def num_control_messages : Pointer(UInt32) | Nil #

[View source]
def num_control_messages! #

[View source]
def num_vectors : UInt32 #

[View source]
def num_vectors=(value : UInt32) #

[View source]
def to_unsafe #

[View source]
def vectors : Enumerable(Gio::InputVector) | Nil #

[View source]
def vectors! #

[View source]