aboutsummaryrefslogtreecommitdiffstats
path: root/link/link-protocol.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-04 10:06:41 +0100
committereunhhu <[email protected]>2026-10-04 10:06:41 +0100
commit578d0ab47f22e0185987ed3f8c091129985cec6e (patch)
tree76ceb7817dc33900198527f9c8f099ef28574ed8 /link/link-protocol.h
parent9e00bf66f5957a1c2aec48f3f00c91f83ba401c8 (diff)
downloadpure-578d0ab47f22e0185987ed3f8c091129985cec6e.tar.gz
pure-578d0ab47f22e0185987ed3f8c091129985cec6e.zip
Let a link's receiver find its streams' inputs again (017, stage 3)
A stream finds its input once, when it is made; an app that starts again with another module may have the input at another number, of another shape, or none. pure_link_receiver_rebind marks the streams to inputs of a prefix stale: each finds its input again by name, with the fields it was laid out with, before its next delivery and at its sender's next packet, keeping what it holds; one none takes is refused as a new one would be. pure_link_listener_rebind asks it of the listener's thread. test-link's rebound case stops its app, starts it with the input at another number, then of another shape taken by name: all 3,000 records come once, in order (without the rebind, none after the stop).
Diffstat (limited to 'link/link-protocol.h')
-rw-r--r--link/link-protocol.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/link/link-protocol.h b/link/link-protocol.h
index feff543..4f263b2 100644
--- a/link/link-protocol.h
+++ b/link/link-protocol.h
@@ -278,6 +278,12 @@ void pure_link_receiver_take(PureLinkReceiver *, const unsigned char *packet, si
* go. */
void pure_link_receiver_turn(PureLinkReceiver *, const PureLinkDone *done, size_t count, uint64_t now,
PureLinkSend *send, void *context);
+/* The host's inputs whose names begin with prefix may be others now (an app
+ * started again with another module): their streams find theirs again, by
+ * name and with the fields they were laid out with, before their next
+ * delivery, a delivery out first done; what they hold stays. One no input
+ * takes now is refused at its sender's next packet, as a new one would be. */
+void pure_link_receiver_rebind(PureLinkReceiver *, const char *prefix);
/* When a turn is due with no packet (ns), or 0 for none. */
uint64_t pure_link_receiver_due(const PureLinkReceiver *);
void pure_link_receiver_counts(const PureLinkReceiver *, PureLinkCounts *);