I am using SignalR in my app.I have an app which depends to a very great degree on OnDisconnected()
being called correctly. And it is called correctly under the following circumstances:
public Task OnDisconnected()
{
try
{
DeleteUser(Context.ConnectionId);
return null;
}
catch (Exception ex)
{
return null;
}
}
- The user refreshes the page
- The user navigates to a new page
- The user closes the browser
However, it is not called if the network connection suddenly drops. For instance, if I unplug the network cable on the client machine, or disable the client's wireless network, or unplug the router, OnDisconnected()
will never get called, even after a several minute wait.