In signalr documentation, the DisconnectTimeout is 30s by default.
But I tried to change it, but the value of DictonnectTimeout still always 30s.
class Startup
{
public void Configuration(IAppBuilder app)
{
// 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(10);
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR("/signalr", new HubConfiguration() { EnableDetailedErrors = true });
}
}
I tested it, by closing the connection for a client, and the signalr server did 30s to terminate this connection.
So, my configuration didn't work :
// 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);
// 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(10);
Hi noteStylet,
Above code is used for setting the disconnection timeout value. Please use above code in Application_Start:
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);
RouteTable.Routes.MapHubs();
}
Thanks,
Best Regard
csharpsignalrselfhosted
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Member
1 Points
7 Posts
Signalr GlobalHost.Configuration.DisconnectTimeout doesn't configured
Sep 15, 2014 05:26 AM|noteStylet|LINK
Hello,
In signalr documentation, the DisconnectTimeout is 30s by default.
But I tried to change it, but the value of DictonnectTimeout still always 30s.
I tested it, by closing the connection for a client, and the signalr server did 30s to terminate this connection.
So, my configuration didn't work :
Why ? I missed something ?
Thank you.
csharp signalr selfhosted
All-Star
30411 Points
3628 Posts
Re: Signalr GlobalHost.Configuration.DisconnectTimeout doesn't configured
Sep 18, 2014 04:13 AM|Fuxiang Zhang - MSFT|LINK
Hi noteStylet,
Above code is used for setting the disconnection timeout value. Please use above code in Application_Start:
Thanks,
Best Regard
csharp signalr selfhosted
Member
1 Points
7 Posts
Re: Signalr GlobalHost.Configuration.DisconnectTimeout doesn't configured
Sep 24, 2014 04:09 AM|noteStylet|LINK
Thanks for your help !
csharp signalr selfhosted