Closed Adidi closed 3 years ago
"Bad practice" is putting it lightly ;D
If the server has no timeout whatsoever it will just hang on to irrelevant resources forever. There is no guarantee RST or FIN packets will reach the server and there is no guarantee the client will ever send those. That's why a timeout is needed.
In v19 this whole thing will be entirely automatic but you still need to specify idleTimeout.
Thanks !
Amazing job Alex on this lib.
I am building a product that needed chat application - I worked with several commercial solution like pubnub
and pusher
and it was horrible experience.
Your library so far - although very low level - just seems to work perfectly. Kudos !
I have a flutter client application that connected to
uwebsockets.js
server and everything works fine. In flutter (I guess also in the websocket spec) you can definepingInterval
which sendsping
message every[interval]
timeframe. So if I construct my server with idleTimeout thepingInterval
will create thekeep alive
effect My question is why do i need it ? is it a bad practice for the server to not have idleTimeout and always stay connected to the client ?Thanks