Safe Haskell | Safe-Inferred |
---|
Implementation of low level messages from the LINX Gateway protocol. Details about the protocol can be found at: http://linx.sourceforge.net/linxdoc/doc/linxprotocols/book-linx-protocols-html/index.html
- data Message = Message !Header !ProtocolPayload
- data Header = Header {}
- data ProtocolPayload
- = FailedRequest
- | InterfaceRequest { }
- | InterfaceReply {
- status :: !Status
- version :: !Version
- flags :: !Flags
- typesLen :: !Length
- payloadTypes :: ![PayloadType]
- | CreateRequest { }
- | CreateReply { }
- | DestroyRequest { }
- | DestroyReply { }
- | HuntRequest { }
- | HuntReply { }
- | ReceiveRequest {
- timeout :: !Timeout
- sigSel :: !SignalSelector
- | ReceiveReply { }
- | SendRequest { }
- | SendReply { }
- | AttachRequest { }
- | AttachReply { }
- | DetachRequest { }
- | DetachReply { }
- | NameRequest { }
- | NameReply { }
- data PayloadType
- = InterfaceRequestOp
- | InterfaceReplyOp
- | LoginRequestOp
- | ChallengeResponseOp
- | ChallengeReplyOp
- | LoginReplyOp
- | CreateRequestOp
- | CreateReplyOp
- | DestroyRequestOp
- | DestroyReplyOp
- | SendRequestOp
- | SendReplyOp
- | ReceiveRequestOp
- | ReceiveReplyOp
- | HuntRequestOp
- | HuntReplyOp
- | AttachRequestOp
- | AttachReplyOp
- | DetachRequestOp
- | DetachReplyOp
- | NameRequestOp
- | NameReplyOp
- encode :: Binary a => a -> ByteString
- mkInterfaceRequest :: Version -> Flags -> Message
- mkInterfaceReply :: Version -> Flags -> [PayloadType] -> Message
- mkCreateRequest :: String -> Message
- mkCreateReply :: Pid -> Length -> Message
- mkDestroyRequest :: Pid -> Message
- mkDestroyReply :: Message
- mkHuntRequest :: Signal -> CString -> Message
- mkHuntReply :: Pid -> Message
- mkReceiveRequest :: Timeout -> SignalSelector -> Message
- mkReceiveReply :: Pid -> Pid -> Signal -> Message
- mkSendRequest :: Pid -> Pid -> Signal -> Message
- mkSendReply :: Message
- mkAttachRequest :: Pid -> Signal -> Message
- mkAttachReply :: Attref -> Message
- mkDetachRequest :: Attref -> Message
- mkDetachReply :: Message
- mkNameRequest :: Message
- mkNameReply :: String -> Message
- headerSize :: Length
- decodeHeader :: ByteString -> Header
- decodeProtocolPayload :: PayloadType -> ByteString -> ProtocolPayload
Documentation
Message, carrying a Header
and a ProtocolPayload
.
Message header.
Header | |
|
data ProtocolPayload Source
Protocol payload.
FailedRequest | |
InterfaceRequest | This request has two puposes. The client sends this request to retrieve information about the gateway server, e.g. supported requests, protocol verions etc. It is also used as a ping-message to check that the server is alive. |
InterfaceReply | |
| |
CreateRequest | This request it used to create a client instance on the server that the client communicated with. |
CreateReply | |
DestroyRequest | This request is used to remove a client instance on the server, i.e. end the session that was started with the create request. |
DestroyReply | |
HuntRequest | This request is to used to ask the gateway server to execute a hunt call. |
HuntReply | |
ReceiveRequest | This request is used to ask the server to execute a receive or receive_w_tmo call. It differs from other requests, because the client may send a second receive request or an interface request before it has received the reply from the previous receive request. The client may send a second receive request to cancel the first one. Beware that server may already have sent a receive reply before the cancel request was received, in this case the client must also wait for the cancel reply. The client may send an interface request to the server, which returns an interface reply. This is used by the client to detect if the server has died while waiting for a receive reply. |
| |
ReceiveReply | |
SendRequest | This request is used to ask the gateway server to execute a send or send_w_s call. |
SendReply | |
AttachRequest | This request is used to ask the gateway server to execute an attach call. |
AttachReply | |
DetachRequest | This request is used to ask the gateway server to execute a detach call. |
DetachReply | |
NameRequest | This request is to retrieve the gateway server's mame. |
NameReply | |
Eq ProtocolPayload | |
Show ProtocolPayload | |
Binary ProtocolPayload | Binary instance for |
data PayloadType Source
Payload type discriminator.
Eq PayloadType | |
Show PayloadType | |
Binary PayloadType | Binary instance for |
encode :: Binary a => a -> ByteString
Encode a value using binary serialisation to a lazy ByteString.
mkInterfaceRequest :: Version -> Flags -> MessageSource
Make an InterfaceRequest
message.
mkInterfaceReply :: Version -> Flags -> [PayloadType] -> MessageSource
Make an InterfaceReply
message.
mkCreateRequest :: String -> MessageSource
Make a CreateRequest
message.
mkCreateReply :: Pid -> Length -> MessageSource
Make a CreateReply
message.
mkDestroyRequest :: Pid -> MessageSource
Make a DestroyRequest
message.
mkDestroyReply :: MessageSource
Make a DestroyReply
message.
mkHuntRequest :: Signal -> CString -> MessageSource
Make a HuntRequest
message.
mkHuntReply :: Pid -> MessageSource
Make a HuntReply
message.
mkReceiveRequest :: Timeout -> SignalSelector -> MessageSource
Make a ReceiveRequest
message.
mkReceiveReply :: Pid -> Pid -> Signal -> MessageSource
Make a ReceiveReply
message.
mkSendRequest :: Pid -> Pid -> Signal -> MessageSource
Make a SendRequest
message.
Make SendReply
message.
mkAttachRequest :: Pid -> Signal -> MessageSource
Make AttachRequest
message.
mkAttachReply :: Attref -> MessageSource
Make AttachReply
message.
mkDetachRequest :: Attref -> MessageSource
Make DetachRequest
message.
mkDetachReply :: MessageSource
Make DetachReply
message.
mkNameRequest :: MessageSource
Make NameRequest
message.
mkNameReply :: String -> MessageSource
Make NameReply
message.
Get the header size in bytes.
decodeHeader :: ByteString -> HeaderSource
Decode the header.
decodeProtocolPayload :: PayloadType -> ByteString -> ProtocolPayloadSource
Decode the protocol payload.