forked from SignalR/SignalR
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring SignalR
davidfowl edited this page May 12, 2012
·
15 revisions
Each host has access to an IConfigurationManager which allows you to tweak some default SignalR settings. Some things that can be tweaked are:
- ConnectionTimeout - Represents the amount of time to leave a connection open before timing out. Default is 110 seconds.
- DisconnectTimeout - Represents the amount of time to wait after a connection goes away before raising the disconnect event. Default is 20 seconds.
- HeartBeatInterval - Represents the interval for checking the state of a connection. Default is 10 seconds.
- KeepAlive - Representing the amount of time to wait before sending a keep alive packet over an idle connection. Set to null to disable keep alive. This is null by default.
ASP.NET Example (Global.asax)
using System;
using SignalR;
namespace WebApplication1
{
public class Global : System.Web.HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Make connections wait 50s maximum for any response. After
// 50s are up, trigger a timeout command and make the client reconnect.
GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(50);
}
}
}