4 ms·
> No ping/pong Author here. Are you referring to the ping/pong message frames in the WebSocket transport protocol, or just a general heartbeating protocol lay
by joewalnes 13y ago
> No ping/pong
Author here.
Are you referring to the ping/pong message frames in the WebSocket transport protocol, or just a general heartbeating protocol layered on top of WebSockets?
If it's the former, then there's nothing ReconnectingWebSocket can do here as this is not exposed by through the standard JavaScript API. Even if it was exposed, I'm not entirely sure what it would do.
The latter requires a custom protocol built on top of the user's WebSocket messages. This would require additional code on the server to process the messages. Libraries would have to be created for the various server side WebSocket implementations. It's a much messier abstraction, and I'd prefer this library to stick to one thing and do it well.
> no mention of what happens to messages in
> transit when the connection drops
In this regard it behaves exactly like a regular WebSocket connection - the message is lost. All this library care of is ensuring that a new connection is opened.
- DanWaterworth 13y ago> Are you referring to the ping/pong message frames in the WebSocket transport protocol, or just a general heartbeating protocol layered on top of WebSockets? I'm talking about a protocol layered on top, for exactly the reason you state. > In this regard it behaves exactly like a regular WebSocket connection - the message is lost. But it doesn't, with a regular WebSocket connection, you know that if a subsequent message is received and responded to, all previous messages were also received. > It's a much messier abstraction, and I'd prefer this library to stick to one thing and do it well. It doesn't and can't. What you've created is completely trivial. If it was indeed better, it would be the behaviour of WebSockets by default.