ouroboros-network-framework-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Network.Protocol.Handshake.Codec

Synopsis

Documentation

codecHandshake ∷ ∀ vNumber m failure. (MonadST m, Ord vNumber, Show failure) ⇒ CodecCBORTerm (failure, Maybe Int) vNumber → Codec (Handshake vNumber Term) DeserialiseFailure m ByteString Source #

Handshake codec. The MsgProposeVersions encodes proposed map in ascending order and it expects to receive them in this order. This allows to construct the map in linear time. There is also another limiting factor to the number of versions on can present: the whole message must fit into a single TCP segment.

byteLimitsHandshake ∷ ∀ vNumber. ProtocolSizeLimits (Handshake vNumber Term) ByteString Source #

Byte limits

timeLimitsHandshake ∷ ∀ vNumber. ProtocolTimeLimits (Handshake vNumber Term) Source #

Time limits.

encodeRefuseReasonCodecCBORTerm fail vNumber → RefuseReason vNumber → Encoding Source #

decodeRefuseReasonShow failure ⇒ CodecCBORTerm (failure, Maybe Int) vNumber → Decoder s (RefuseReason vNumber) Source #

Version data codec

data VersionDataCodec bytes vNumber vData Source #

Codec for version data (vData in code) exchanged by the handshake protocol.

Note: extra type param is instantiated to DictVersion; agreedOptions is instantiated to NodeToNodeVersionData in Ouroboros.Network.NodeToNode or to () in Ouroboros.Network.NodeToClient.

Constructors

VersionDataCodec 

Fields

  • encodeData ∷ vNumber → vData → bytes

    encoder of vData which has access to 'extra vData' which can bring extra instances into the scope (by means of pattern matching on a GADT).

  • decodeData ∷ vNumber → bytes → Either Text vData

    decoder of vData.

cborTermVersionDataCodec ∷ (vNumber → CodecCBORTerm Text vData) → VersionDataCodec Term vNumber vData Source #