gi-gio-2.0.25: Gio bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gio.Structs.InputMessage

Description

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 bytesReceived 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-Nothing then it is set to the source address the message was received from, and the caller must free it afterwards.

If controlMessages is non-Nothing then it is set to an array of control messages received with the message (if any), and the caller must free it afterwards. numControlMessages 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.

Since: 2.48

Synopsis

Exported types

newZeroInputMessage :: MonadIO m => m InputMessage Source #

Construct a InputMessage struct initialized to zero.

Methods

Overloaded methods

Properties

address

return location for a SocketAddress, or Nothing

clearInputMessageAddress :: MonadIO m => InputMessage -> m () Source #

Set the value of the “address” field to Nothing. When overloading is enabled, this is equivalent to

clear #address

getInputMessageAddress :: MonadIO m => InputMessage -> m (Maybe SocketAddress) Source #

Get the value of the “address” field. When overloading is enabled, this is equivalent to

get inputMessage #address

setInputMessageAddress :: MonadIO m => InputMessage -> Ptr SocketAddress -> m () Source #

Set the value of the “address” field. When overloading is enabled, this is equivalent to

set inputMessage [ #address := value ]

bytesReceived

will be set to the number of bytes that have been received

getInputMessageBytesReceived :: MonadIO m => InputMessage -> m Word64 Source #

Get the value of the “bytes_received” field. When overloading is enabled, this is equivalent to

get inputMessage #bytesReceived

setInputMessageBytesReceived :: MonadIO m => InputMessage -> Word64 -> m () Source #

Set the value of the “bytes_received” field. When overloading is enabled, this is equivalent to

set inputMessage [ #bytesReceived := value ]

flags

collection of SocketMsgFlags for the received message, outputted by the call

getInputMessageFlags :: MonadIO m => InputMessage -> m Int32 Source #

Get the value of the “flags” field. When overloading is enabled, this is equivalent to

get inputMessage #flags

setInputMessageFlags :: MonadIO m => InputMessage -> Int32 -> m () Source #

Set the value of the “flags” field. When overloading is enabled, this is equivalent to

set inputMessage [ #flags := value ]

numControlMessages

return location for the number of elements in controlMessages

getInputMessageNumControlMessages :: MonadIO m => InputMessage -> m Word32 Source #

Get the value of the “num_control_messages” field. When overloading is enabled, this is equivalent to

get inputMessage #numControlMessages

setInputMessageNumControlMessages :: MonadIO m => InputMessage -> Word32 -> m () Source #

Set the value of the “num_control_messages” field. When overloading is enabled, this is equivalent to

set inputMessage [ #numControlMessages := value ]

numVectors

the number of input vectors pointed to by vectors

getInputMessageNumVectors :: MonadIO m => InputMessage -> m Word32 Source #

Get the value of the “num_vectors” field. When overloading is enabled, this is equivalent to

get inputMessage #numVectors

setInputMessageNumVectors :: MonadIO m => InputMessage -> Word32 -> m () Source #

Set the value of the “num_vectors” field. When overloading is enabled, this is equivalent to

set inputMessage [ #numVectors := value ]