Our great sponsors
-
engine.io
The engine used in the Socket.IO JavaScript server, which manages the low-level transports such as HTTP long-polling and WebSocket.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
Primus
:zap: Primus, the creator god of the transformers & an abstraction layer for real-time to prevent module lock-in.
Ah, yep, that explains it.
They do solve this problem as documented: https://github.com/socketio/engine.io/blob/64d57545116c7a7d9...
> Conversely, if the client does not receive a PING packet within `pingInterval + pingTimeout`, it will consider that the connection is closed.
Indeed looks like a solid way to solve the client-side recognition of a broken connection!
--
That said, I'm a little confused because I cannot find any mention of `pingTimeout` in their JS client [0], and `pingInterval` is only mentioned in an implementation of a test server [1]. I wonder if I'm looking at the wrong thing.
[0]: https://github.com/socketio/socket.io-client/search?q=pingti...
Indeed it does! https://github.com/primus/primus/blob/a7ba7249cb0205a01629da...
I do wish we didn't all have to reinvent this wheel though…
Related posts
- Technologies to create a chat application with different channels like Slack?
- WebSockets and Node.js - testing WS and SockJS by building a web app
- Socket io not working on deployed version
- Hi guys, just wanted to share that I tried to create a better omegle alternative. Open to any feedback!
- Onde estou errando? ( Dias sem progresso )