benchmarking printfs
^+ [fragments gifts state]
:: return unsent back to caller and reverse effects to finalize
::
- =- ~& %alef-feed^(lent fragments)^%unsent^(lent unsent)
+ =- ::~& %alef-feed^(lent fragments)^%unsent^(lent unsent)
[unsent (flop gifts) state]
::
^+ [unsent=fragments packet-pump]
?. found.-
~& %alef-hear-noop
packet-pump
- ~& %alef-hear-ack^message-num^fragment-num
+ ::~& %alef-hear-ack^message-num^fragment-num
::
=. metrics.state metrics.-
=. live.state live.-
message-still
:: ack all other packets
::
- ~& %send-ack^fragment-num
+ ::~& %send-ack^fragment-num
(give %send seq %& fragment-num)
:: last-heard<seq<10+last-heard; this is a packet in a live message
::
:: ack any packet other than the last one, and continue either way
::
=? message-still !is-last-fragment
- ~& %send-ack^fragment-num
+ ::~& %send-ack^fragment-num
(give %send seq %& fragment-num)
:: enqueue all completed messages starting at +(last-heard.state)
::
=. last-heard.state +(last-heard.state)
=. live-messages.state (~(del by live-messages.state) seq)
::
+ ~& %ames-still-rcv-kb^num-fragments.u.live
=/ message=* (assemble-fragments [num-fragments fragments]:u.live)
=. message-still (enqueue-to-vane seq message)
::
