Instances2Show, Exception
Show BearerConnectionClosedDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Protocols.BearerUtilException BearerConnectionClosedDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Protocols.BearerUtil
:: a typeCtrl KGHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12
Modulekes-agent-1.3.0.0Haskell2010
Show BearerConnectionClosedDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Protocols.BearerUtilException BearerConnectionClosedDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Protocols.BearerUtilWrap a raw bearer connection such that client disconnects are detected in
a timely fashion. We do this by moving reads to a separate thread, and
buffering their results; this way, the recv call happens before the
protocol expects to receive anything, which will block until the connection
is closed, or until any data is sent.
*Note that this violates mlocking guarantees for incoming data.* This means
that this wrapper should only be used on connections where mlocking is not
needed for incoming data, only outgoing.
In practice, we will only use this on the agent side of the service
protocol; this is fine, because the client never sends anything that needs
to be mlocked, and data from the server (== agent) to the client isn't
buffered.
The client side of the service protocol doesn't need this, because it is
already in a receiving state when the protocol is idle, so it will detect
disconnects fast.
The control protocol doesn't need this either, because interactions follow a
typical request-response patterns, and will, in practice, establish a new
connection for each request-response cycle.