How does the SignalR handle client disconnection? Am I right if I state the following?
- SignalR will detect browser page close/refresh via Javascript event handling and will send appropriate packet to server (through the persisting connection);
- SignalR will NOT detect browser close/network failure (probably only by timeout).
I aim the long-polling transport.
I’m aware of this question but would like to make it a bit clear for me.
If a user refreshes the page, that is treated as a new connection. You are correct that the disconnect is based on a timeout.You can handle the Connect/Reconnect and Disconnect events in a Hub by implementing
SignalR.Hubs.IConnectedandSignalR.Hubs.IDisconnect.The above referred to SignalR 0.5.x.
From the official documentation (currently for v1.1.3):