Detect 'server offline' with SignalR
问题 We are attempting to use SignalR in an low-bandwidth environment where the connection to the backend server can come and go randomly, and we want our web application to respond appropriately. It looks like this connection API has been in flux over the past year, but in accordance with the latest documentation, I have tried hooking up to $.connection.hub.stateChanged to detect changes in the connection status, and I get a couple hits on startup when the client goes from disconnected ->