If the device closes the connection, it won't be possible to receive those messages until the connection is re-established... once the connection is re-established you'll need to grab the data that was created while the connection was down and handle the integration of everything
great tutorial! these aren't actual websocket control frames correct, as those aren't exposed in the NodeJS ws api? this is a home-brew ping/pong/keepalive just using a simple binary msg that is agreed upon by server and client?
Hi, isn't the web socket has the default heartbeat feature. What is the difference between this implementation and the default heartbeat supoported by socket?
@@covalence-io Hi, I didn't see it in the docs as well. But if you open the network tab in dev tool and inspect the socket connection there, you will it will send heartbeat per 3-5 seconds.
What is the idea for instant streaming function? Like the server is sending something and as soon as send it is received by everyone. Websocket sucks on instant data transfer. I mean it can't be used to transfer continues like every 10 millisecond 😢
websockets are pretty much the best solution we currently have for real time data reception. if your current web socket solution is too slow, you may need more instances or better instances to handle the load.
If you are running at 10 milliseconds my guess is you've set your websockets on port 403... Hey, use UDP protocal for video it is lightening fast ! With udp you have no encryption and you may loose a few packets on the road though. Luckly there are solutions for detecting and handeling corrupt packages.
It sounds like your client is ending the connection when the browser is minimized. Generally the client should explicitly end the connection in this case... but the heartbeats are essentially a catch all that will allow the server and/or client to "realize" the connection no longer exists. You most likely need to implement good reconnect logic in your client to make sure it can pick it back up when it needs to.
Can you please make a video on the actual way how to recconect if the connection closed? It'd be more helpful if you could make a video for flutter - client
hi, when user put their phone on sleep mode, the ws connection is close, all the message during that time is not sending,how to deal with this
If the device closes the connection, it won't be possible to receive those messages until the connection is re-established... once the connection is re-established you'll need to grab the data that was created while the connection was down and handle the integration of everything
great tutorial! these aren't actual websocket control frames correct, as those aren't exposed in the NodeJS ws api? this is a home-brew ping/pong/keepalive just using a simple binary msg that is agreed upon by server and client?
is it optimal enough to have the interval on the server side ?
Hi, isn't the web socket has the default heartbeat feature. What is the difference between this implementation and the default heartbeat supoported by socket?
I'm honestly not aware of any native heartbeat functionality for websockets, but if you have a link to some documentation, send it over!
@@covalence-io Hi, I didn't see it in the docs as well. But if you open the network tab in dev tool and inspect the socket connection there, you will it will send heartbeat per 3-5 seconds.
What is the idea for instant streaming function? Like the server is sending something and as soon as send it is received by everyone.
Websocket sucks on instant data transfer.
I mean it can't be used to transfer continues like every 10 millisecond 😢
websockets are pretty much the best solution we currently have for real time data reception. if your current web socket solution is too slow, you may need more instances or better instances to handle the load.
@@covalence-io I got it. Now is working as expected. My case was running interval in server and stream it🔥
If you are running at 10 milliseconds my guess is you've set your websockets on port 403... Hey, use UDP protocal for video it is lightening fast ! With udp you have no encryption and you may loose a few packets on the road though. Luckly there are solutions for detecting and handeling corrupt packages.
Thank you very much.
This solution can be applyed in context: "Navigator was minimized and socket connection lost"?
It sounds like your client is ending the connection when the browser is minimized. Generally the client should explicitly end the connection in this case... but the heartbeats are essentially a catch all that will allow the server and/or client to "realize" the connection no longer exists. You most likely need to implement good reconnect logic in your client to make sure it can pick it back up when it needs to.
@@covalence-io thanks
Can you please make a video on the actual way how to recconect if the connection closed? It'd be more helpful if you could make a video for flutter - client
Reconnecting is the same as connecting... you simply instantiate a new websocket instance
@@covalence-io Thank you for the quick response
@@covalence-io But current subscriptions do not run again
top tuto thanks
this video does not have the view or thumbs it deserves,
Glad you enjoyed!
websockets are just bad tech. garbage.
Poor guy, may lord have mercy