Tutorial by Examples

When ever a user connects to your hub, the OnConnected() is called. You can over ride this function and implement your own logic if you need to keep track of or limit the number of connections public override Task OnConnected() { //you logic here return base.OnConnected()...
Overloading the disconnect function allows you to handle what to do when a user disconnects. public override Task OnDisconnected(bool stopCalled) { //Your disconnect logic here return base.OnDisconnected(stopCalled); }
/// <summary> /// Overrides the onDisconnected function and sets the user object to offline, this can be checked when other players interacts with them... /// </summary> /// <param name="stopCalled"></param> /// <returns></returns&gt...
If you want to notify other clients/users throughout the application ,you not need to worry about the connection because signalr new connection is created every time you visit other pages in the web app. we can leverage the users feature of signalr to achieve the same. see the example below: Here...

Page 1 of 1