From 578d0ab47f22e0185987ed3f8c091129985cec6e Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 4 Oct 2026 10:06:41 +0100 Subject: 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). --- link/link.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'link/link.h') 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 -- cgit v1.2.3