Yehia Yehia - 1 year ago 67
ASP.NET (C#) Question

What is the event when the user leaves the site in signalr?

What the user is leaving the event site in order to change their status from online to offline and send a message to clients states that he left the site.

Answer Source

You can tie into the disconnected event.

SO in your hub add the method:

public override Task OnDisconnected()
    // The Context.ConnectionId is the identity of the disconnected client
    return Clients.All.userOffline(/* Something here to identify the user */);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download