Detect failed connection #125
Replies: 2 comments 1 reply
-
|
You can use https://github.com/cloudflare/capnweb?tab=readme-ov-file#listening-for-disconnect |
Beta Was this translation helpful? Give feedback.
-
|
It only captures if the connection is first established, and then disconnected.
But the session is useful before (2), since the endpoint can call (1) and hope that it will receive calls from the other endpoint. Right now, there's no good way to verify that except of superfluously calling (2) to verify that the connection is established and capturing the API call failure as lack of connection. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I can tell there's no way to detect a connection failure until an API call is executed.
This means that building a library that wraps around capnweb to handle connection management is tricky as it requires at least one known API to be available to test if the connection succeeded.
I'm not sure if a
newWebSocketRpcSessionis meant to be lazy or eager, but it would be helpful to expose some state information and maybe an explicitconnectcall that can succeed or fail.Beta Was this translation helpful? Give feedback.
All reactions