On Fri, Sep 29, 2023 at 3:36 PM Alex <capnpr...@centromere.net> wrote:
> A. How shall a peer discern between an exceptional connection closure > and a normal one? > > My proposal is to add a new message, "GOODBYE", which allows the system > to signal to its remote peer an intent to close the connection. Right, I get the motivation, but what I'm saying is there is no behavior or API in Cap'n Proto which cares to distinguish between these. Are you proposing adding a new API which would allow the application to learn whether the disconnect was intentional? I think I would prefer that we leave this up to the application instead. That is, an application can always have an RPC method which signals a clean end, without any special support from the underlying transport. This approach keeps the application decoupled from the transport layer, allowing the same code to work with local capabilities or alternative protocols. Note > that this message is communicated within the context of any > encryption/authentication layer which may be in place (such as TLS), > thus allowing application designers to discern between proper operation > and outside interference. > TLS itself already communicates the difference between a clean shutdown and an outside interruption. In KJ, read()ing from a TLS socket will throw an exception if it is prematurely terminated. -Kenton -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/CAJouXQk1nkTFq_Q5%3DtNdkQPa_6Vco0E0GcLfvb%3DY-NbLL-03PA%40mail.gmail.com.