network-msg-0.4: Recvmsg and sendmsg bindings.

Safe HaskellNone
LanguageHaskell98

Network.Socket.Msg

Synopsis

Documentation

data CMsg Source

Constructors

CMsg 

Instances

class Binary a => CMsgable a where Source

Class for binary structures that can be used as control messages (cmsg(3)).

Complete definition requires for a type to be an instance of Binary class, as well as to provide getCMsgLevel and getCMsgType methods.

Note that the argument of getCMsgLevel and getCMsgType methods should not be used as it might be undefined.

Minimal complete definition

getCMsgLevel, getCMsgType

Instances

filterCMsgs :: CMsgable a => a -> [CMsg] -> [CMsg] Source

Filter specific kind of control messages.

Example: filterCMsgs (undefined :: IpPktInfo) cmsgs

sendMsg :: Socket -> ByteString -> SockAddr -> [CMsg] -> IO () Source

Sends the data contained in the bytestring to the specified address. The last argument is a list of control parameters (see cmsg(3) for details).

recvMsg :: Socket -> Int -> IO (ByteString, SockAddr, [CMsg]) Source

Receive data and put it into a bytestring.