HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulenetwork-mux-0.11.0.0Haskell2010

Network.Mux.Codec

  • 2 values
valueencodeSDU :: SDU -> ByteString
#

Encode a SDU as a ByteString.

Binary format used by 'encodeSDU' and 'decodeSDUHeader'
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        transmission time                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|d|    mini-protocol number     |             length            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

All fields are in big endian byte order.

  • transmission time: time when the SDU was sent

  • d: mini-protocol direction (MiniProtocolDir):

    • 1 - initiator direction

    • 0 - responder direction

  • mini-protocol number (MiniProtocolNum)

  • length: length of the payload