socket.io-rpc icon indicating copy to clipboard operation
socket.io-rpc copied to clipboard

How to handle disconnects

Open tombrown52 opened this issue 10 years ago • 2 comments

There is no way to detect when the server has forcibly closed the connection with socket.disconnect().

Are there any methods for connection management, or is it designed to stay connected for the entire lifetime of the browser application?

tombrown52 avatar Nov 03 '14 00:11 tombrown52

it is designed to stay connected for the entire lifetime. If you need to know that the server ended the connection, maybe you could send some special end message to the client before disconnecting him.

capaj avatar Nov 03 '14 19:11 capaj

I would like to display an indicator in the user interface if the connection is not presently available. Without some sort of connect/disconnect notification this is not possible. As a related issue, is there a way to have RPC calls timeout if the server doesn't respond (for whatever reason) within X time?

tombrown52 avatar Nov 03 '14 20:11 tombrown52