Search code examples
asp.net-coresignalr

signalr OnDisconnected method


I am trying to implement an app in which I have used signalr to detect the time at which client is disconnected from server..my hub is like this.. I am using version 0.2.0-alpha

[HubName("TrappistHub")]
public class TrappistHub : Hub
{

    public override Task OnDisconnected(bool stopCalled)
    {
        return base.OnDisconnected(stopCalled);
    }

    public void SendReport(TestAttendees testAttendee)
    {
        Clients.All.getReport(testAttendee);
    }

}

and DisconnectTime is set default. but when I disconnect from from server OnDisconnected method gets hit after 50 secs instead of 30..and when I set the DisconnectTime to 10 secs or 20 secs it is not getting hit at all..but when I refresh the page it is getting hit...I dont understand why..?


Solution

  • The version you are using (i.e. 0.2.0-alpha) is not supported. Use the new version that shipped last week - 1.0.0-alpha1. See the announcement for more details.