aboutsummaryrefslogtreecommitdiffstats
path: root/link/link.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.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.h')
-rw-r--r--link/link.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/link/link.h b/link/link.h
index 9846af4..40fc9f9 100644
--- a/link/link.h
+++ b/link/link.h
@@ -51,5 +51,9 @@ PureLinkListener *pure_link_listen(PureLinkReceiver *, unsigned port, char *erro
bool pure_link_serve(PureLinkListener *, char *error, size_t size);
/* How a delivery went: link-protocol.h's PureLinkDone, with its token. */
void pure_link_done(PureLinkListener *, PureLinkDone);
+/* The host's inputs whose names begin with prefix may be others now: the
+ * receiver's streams to them find theirs again (pure_link_receiver_rebind),
+ * on the listener's thread; any thread. */
+void pure_link_listener_rebind(PureLinkListener *, const char *prefix);
void pure_link_listener_close(PureLinkListener *, PureLinkCounts *counts);
#endif