Allows establishing direct synchronous connections between a single “server” and multiple “clients”.
Synchronous here means that any send calls immediately execute the handler code no the receiving side (after a couple of callback indirections). There is no runtime and no threads and the send call will only return after the handling code has completed.
It does not matter if the server or client is started first, connection is established immediately when the second one joins the connection.
The server prepares by fullfillling the connectionEstablished promise, which contains a callback that allwows any number of clients to connect. The inner callback contains the Connection the server sends on, as well as a promise that the server completes immediately with it’s own receive handler.
The server prepares by fullfillling the connectionEstablished promise, which contains a callback that allwows any number of clients to connect. The inner callback contains the Connection the server sends on, as well as a promise that the server completes immediately with it’s own receive handler.