Last post Jan 08, 2015 04:50 PM by Rion Williams
Jan 08, 2015 05:32 AM|Prabhakar26|LINK
Developing signalr application and i want to keep client alive as long as possible without disconnect.
What should I do , to make my browser should not get disconnect message .
I should able to send events after 6 hrs inactivity also.
Jan 08, 2015 04:50 PM|Rion Williams|LINK
I believe that you can
update various timeout-related settings within your application to possibly adjust some of these things :
protected void Application_Start(object sender, EventArgs e)
// Make long polling connections wait a maximum of 110 seconds for a
// response. When that time expires, trigger a timeout command and
// make the client reconnect.
GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(110);
// Wait a maximum of 30 seconds after a transport connection is lost
// before raising the Disconnected event to terminate the SignalR connection.
GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(30);
// For transports other than long polling, send a keepalive packet every
// 10 seconds.
// This value must be no more than 1/3 of the DisconnectTimeout value.
GlobalHost.Configuration.KeepAlive = TimeSpan.FromSeconds(10);
You could likely just set those values to 6 hours or your preferred settings :
GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromHours(6);