Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- newtype InputMessage = InputMessage (ManagedPtr InputMessage)
- newZeroInputMessage :: MonadIO m => m InputMessage
- clearInputMessageAddress :: MonadIO m => InputMessage -> m ()
- getInputMessageAddress :: MonadIO m => InputMessage -> m (Maybe SocketAddress)
- setInputMessageAddress :: MonadIO m => InputMessage -> Ptr SocketAddress -> m ()
- getInputMessageBytesReceived :: MonadIO m => InputMessage -> m Word64
- setInputMessageBytesReceived :: MonadIO m => InputMessage -> Word64 -> m ()
- getInputMessageFlags :: MonadIO m => InputMessage -> m Int32
- setInputMessageFlags :: MonadIO m => InputMessage -> Int32 -> m ()
- getInputMessageNumControlMessages :: MonadIO m => InputMessage -> m Word32
- setInputMessageNumControlMessages :: MonadIO m => InputMessage -> Word32 -> m ()
- getInputMessageNumVectors :: MonadIO m => InputMessage -> m Word32
- setInputMessageNumVectors :: MonadIO m => InputMessage -> Word32 -> m ()
Exported types
newtype InputMessage Source #
Memory-managed wrapper type.
Instances
Eq InputMessage Source # | |
Defined in GI.Gio.Structs.InputMessage (==) :: InputMessage -> InputMessage -> Bool # (/=) :: InputMessage -> InputMessage -> Bool # | |
BoxedPtr InputMessage Source # | |
Defined in GI.Gio.Structs.InputMessage boxedPtrCopy :: InputMessage -> IO InputMessage # boxedPtrFree :: InputMessage -> IO () # | |
CallocPtr InputMessage Source # | |
Defined in GI.Gio.Structs.InputMessage boxedPtrCalloc :: IO (Ptr InputMessage) # | |
ManagedPtrNewtype InputMessage Source # | |
Defined in GI.Gio.Structs.InputMessage | |
tag ~ 'AttrSet => Constructible InputMessage tag Source # | |
Defined in GI.Gio.Structs.InputMessage new :: MonadIO m => (ManagedPtr InputMessage -> InputMessage) -> [AttrOp InputMessage tag] -> m InputMessage # |
newZeroInputMessage :: MonadIO m => m InputMessage Source #
Construct a InputMessage
struct initialized to zero.
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 ]