Reputation: 1872
I'm writing a chat application with Node.js and ws
there is a on close event which is fired when user gracefully disconnects but when the internet is lost, this event is not fired.
is there anyway we can detect when user has lost the connection?
Upvotes: 1
Views: 203
Reputation: 2742
Best way is to handle own ping/pong methods. It's usable also for measure connection latency.
Upvotes: 1