Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Handshake (vNumber :: k) (vParams :: k1) where
- data SingHandshake (st :: Handshake vNumber vParams) where
- SingPropose :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StPropose :: Handshake vNumber vParams)
- SingConfirm :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StConfirm :: Handshake vNumber vParams)
- SingDone :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StDone :: Handshake vNumber vParams)
- data family Message ps (st :: ps) (st' :: ps)
- data RefuseReason vNumber
- = VersionMismatch [vNumber] [Int]
- | HandshakeDecodeError vNumber Text
- | Refused vNumber Text
- data HandshakeProtocolError vNumber
- = HandshakeError (RefuseReason vNumber)
- | NotRecognisedVersion vNumber
- | InvalidServerSelection vNumber Text
- | QueryNotSupported
- data HandshakeResult r vNumber vData
- = HandshakeNegotiationResult r vNumber vData
- | HandshakeQueryResult (Map vNumber (Either Text vData))
Handshake Protocol
data Handshake (vNumber :: k) (vParams :: k1) where Source #
The handshake mini-protocol is used initially to agree the version and associated parameters of the protocol to use for all subsequent communication.
StPropose :: forall {k} {k1} (vNumber :: k) (vParams :: k1). Handshake vNumber vParams | |
StConfirm :: forall {k} {k1} (vNumber :: k) (vParams :: k1). Handshake vNumber vParams | |
StDone :: forall {k} {k1} (vNumber :: k) (vParams :: k1). Handshake vNumber vParams |
Instances
ShowProxy (Handshake vNumber vParams :: Type) Source # | |||||
(NFData vNumber, NFData vParams) => NFData (Message (Handshake vNumber vParams) from to) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type | |||||
(Show vNumber, Show vParams) => Show (Message (Handshake vNumber vParams) from to) Source # | |||||
Protocol (Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type
| |||||
StateTokenI ('StConfirm :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type stateToken :: StateToken ('StConfirm :: Handshake vNumber vParams) # | |||||
StateTokenI ('StDone :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type stateToken :: StateToken ('StDone :: Handshake vNumber vParams) # | |||||
StateTokenI ('StPropose :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type stateToken :: StateToken ('StPropose :: Handshake vNumber vParams) # | |||||
data Message (Handshake vNumber vParams) (from :: Handshake vNumber vParams) (to :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type data Message (Handshake vNumber vParams) (from :: Handshake vNumber vParams) (to :: Handshake vNumber vParams) where
| |||||
type StateToken Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type | |||||
type StateAgency ('StConfirm :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type | |||||
type StateAgency ('StDone :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type | |||||
type StateAgency ('StPropose :: Handshake vNumber vParams) Source # | |||||
Defined in Ouroboros.Network.Protocol.Handshake.Type |
data SingHandshake (st :: Handshake vNumber vParams) where Source #
SingPropose :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StPropose :: Handshake vNumber vParams) | |
SingConfirm :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StConfirm :: Handshake vNumber vParams) | |
SingDone :: forall {k} {k1} {vNumber :: k} {vParams :: k1}. SingHandshake ('StDone :: Handshake vNumber vParams) |
Instances
Show (SingHandshake st) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type showsPrec :: Int -> SingHandshake st -> ShowS # show :: SingHandshake st -> String # showList :: [SingHandshake st] -> ShowS # |
data family Message ps (st :: ps) (st' :: ps) #
The messages for this protocol. It is expected to be a GADT that is
indexed by the from
and to
protocol states. That is the protocol state
the message transitions from, and the protocol state it transitions into.
These are the edges of the protocol state transition system.
Instances
(NFData vNumber, NFData vParams) => NFData (Message (Handshake vNumber vParams) from to) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type | |
(Show vNumber, Show vParams) => Show (Message (Handshake vNumber vParams) from to) Source # | |
data Message (Handshake vNumber vParams) (from :: Handshake vNumber vParams) (to :: Handshake vNumber vParams) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type data Message (Handshake vNumber vParams) (from :: Handshake vNumber vParams) (to :: Handshake vNumber vParams) where
|
On simultaneous open both sides will send MsgProposeVersions
, which will be
decoded as MsgReplyVersions
. It is a terminal message of the protocol. It
is important to stress that in this case both sides will make the choice
which version and parameters to pick. Our algorithm for picking version is
symmetric, which ensures that both sides will end up with the same choice.
If one side decides to refuse the version it will close the connection,
without sending the reason to the other side.
data RefuseReason vNumber Source #
Reasons by which a server can refuse proposed version.
VersionMismatch [vNumber] [Int] | All of the prosed versions where not known to the server.
Since the server sends all versions that it can knows about, some of them
we might not be able to decode, so we include raw tags |
HandshakeDecodeError vNumber Text | The server failed to decode version parameters. |
Refused vNumber Text | The server refused to run the proposed version parameters |
Instances
data HandshakeProtocolError vNumber Source #
Extends handshake error
type, by client specific errors.RefuseReason
HandshakeError (RefuseReason vNumber) | |
NotRecognisedVersion vNumber | |
InvalidServerSelection vNumber Text | |
QueryNotSupported |
Instances
(Typeable vNumber, Show vNumber) => Exception (HandshakeProtocolError vNumber) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type toException :: HandshakeProtocolError vNumber -> SomeException # fromException :: SomeException -> Maybe (HandshakeProtocolError vNumber) # displayException :: HandshakeProtocolError vNumber -> String # backtraceDesired :: HandshakeProtocolError vNumber -> Bool # | |
Show vNumber => Show (HandshakeProtocolError vNumber) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type showsPrec :: Int -> HandshakeProtocolError vNumber -> ShowS # show :: HandshakeProtocolError vNumber -> String # showList :: [HandshakeProtocolError vNumber] -> ShowS # | |
Eq vNumber => Eq (HandshakeProtocolError vNumber) Source # | |
Defined in Ouroboros.Network.Protocol.Handshake.Type (==) :: HandshakeProtocolError vNumber -> HandshakeProtocolError vNumber -> Bool # (/=) :: HandshakeProtocolError vNumber -> HandshakeProtocolError vNumber -> Bool # |
data HandshakeResult r vNumber vData Source #
The result of a handshake.
HandshakeNegotiationResult r vNumber vData | |
HandshakeQueryResult (Map vNumber (Either Text vData)) |