(calculate-start-stop-bytes {{:keys [:frereth.cp.message.specs/receive-written]
:as incoming}
:frereth.cp.message.specs/incoming
:keys [:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as state}
{incoming-buf :frereth.cp.message.specs/buf
D :frereth.cp.message.specs/size-and-flags
start-byte :frereth.cp.message.specs/start-byte
:as packet})
Extract start/stop ACK addresses (lines 562-574)
Extract start/stop ACK addresses (lines 562-574)
(cope-with-child-eof {{:keys [:frereth.cp.message.specs/send-eof
:frereth.cp.message.specs/un-ackd-blocks
:frereth.cp.message.specs/un-sent-blocks]}
:frereth.cp.message.specs/outgoing
:keys [:frereth.cp.message.specs/message-loop-name]
:as state})
If the child's sent EOF, and all blocks have been sent/ACK'd, we're done
If the child's sent EOF, and all blocks have been sent/ACK'd, we're done
(deserialize log-state incoming)
Convert a raw message block into a message structure
Convert a raw message block into a message structure
(extract-message! {{:keys [:frereth.cp.message.specs/gap-buffer
:frereth.cp.message.specs/strm-hwm]}
:frereth.cp.message.specs/incoming
:keys [:frereth.cp.message.specs/message-loop-name]
:as state}
{incoming-buf :frereth.cp.message.specs/buf
D :frereth.cp.message.specs/size-and-flags
start-byte :frereth.cp.message.specs/start-byte
:keys [:frereth.cp.message.specs/message-id]
:as packet})
Lines 562-593
Lines 562-593
(flag-ackd-others! {:keys [:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as state}
{:keys [:frereth.cp.message.specs/message-id] :as packet})
Cope with sent message the other side just ACK'd
Lines 544-560
Cope with sent message the other side just ACK'd Lines 544-560
(flag-blocks-ackd-by-id {:keys [:frereth.cp.message.specs/message-loop-name]
{:keys [:frereth.cp.message.specs/un-ackd-blocks]
:as outgoing}
:frereth.cp.message.specs/outgoing
:as state}
ackd-blocks)
Reference implementation ignores these
Reference implementation ignores these
(handle-incoming-ack
{:keys [:frereth.cp.message.specs/message-loop-name]
{:keys [:frereth.cp.message.specs/un-ackd-blocks] :as outgoing}
:frereth.cp.message.specs/outgoing
:as initial-state}
{:keys [:frereth.cp.message.specs/acked-message] :as packet})
Update outbound queues w/ new ACKs
Update outbound queues w/ new ACKs
(possibly-ack! io-handle
{{parent->buffer :frereth.cp.message.specs/parent->buffer}
:frereth.cp.message.specs/incoming
{original-eof :frereth.cp.message.specs/receive-eof
:as original-incoming}
:frereth.cp.message.specs/incoming
{:keys [:frereth.cp.message.specs/un-ackd-blocks] :as outgoing}
:frereth.cp.message.specs/outgoing
:keys [:frereth.cp.message.specs/flow-control
:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as state})
handle this message if it's comprehensible: (DJB)
This seems like the interesting part. lines 444-609
handle this message if it's comprehensible: (DJB) This seems like the interesting part. lines 444-609
(prep-send-ack {{:keys [:frereth.cp.message.specs/contiguous-stream-count
:frereth.cp.message.specs/receive-eof
:frereth.cp.message.specs/receive-total-bytes
:frereth.cp.message.specs/receive-written
:frereth.cp.message.specs/strm-hwm]}
:frereth.cp.message.specs/incoming
:keys [:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as state}
message-id)
Build a byte array to ACK the message we just received
Build a byte array to ACK the message we just received
(send-ack! {:keys [:frereth.weald.specs/logger
:frereth.cp.message.specs/->parent]
:as io-handle}
send-buf
log-state)
Write ACK buffer back to parent
Line 608
Write ACK buffer back to parent Line 608
(try-processing-message! io-handle
{{:keys [:frereth.cp.message.specs/->child-buffer
:frereth.cp.message.specs/parent->buffer
:frereth.cp.message.specs/receive-written
:frereth.cp.message.specs/strm-hwm]}
:frereth.cp.message.specs/incoming
:keys [:frereth.cp.message.specs/message-loop-name]
log-state :frereth.weald.specs/state
:as state})
436-613: try processing a message: --DJB
436-613: try processing a message: --DJB
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close