Yehia Yehia - 19 days ago 4
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

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 */);
}