Last post Nov 25, 2014 05:15 AM by Ruchira
Nov 24, 2014 01:03 AM|mohitsoftage|LINK
By default signalR try to reconnect the client if connectivity is lost. How can i achieve that if a connection is lost i want to call OnDisconnect directly. (I want in a scenario where mobile data connections had been made off i want to disconnect since
internet is already made off so no need to connect and start storing message in queue instead of sending them.) or any other suggestion is also welcomed.
Nov 25, 2014 12:15 AM|Fei Han - MSFT|LINK
Thanks for your post.
SignalR will try to reconnect to the existing connection when it is lost, in which case it would retain its connection id once reconnected. you could notify the user about disconnections, it will be better than disconnecting SignalR instantly.
You could check “How to notify the user about disconnections” section in this article.
Hope it will be helpful to you.
Nov 25, 2014 05:15 AM|Ruchira|LINK
You can try by setting the KeepAlive and DisconnectTimeout values to 0.
protected void Application_Start(object sender, EventArgs e)
GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(0);
GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(0);
Please 'Mark as Answer' if this post helps you