Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modified KeepAlive to be an integer instead of a TimeSpan

- Next step is to modify the rest of the code base to now use the
integer based KeepAlive

#1091
  • Loading branch information...
commit a27f41f3271d67ce08fb6e82741d77e637bf7753 1 parent d7b1453
@NTaylorMullen NTaylorMullen authored
View
22 src/Microsoft.AspNet.SignalR.Core/Configuration/DefaultConfigurationManager.cs
@@ -1,17 +1,20 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
+using System.Globalization;
namespace Microsoft.AspNet.SignalR.Configuration
{
public class DefaultConfigurationManager : IConfigurationManager
{
+ private int _keepAlive;
+
public DefaultConfigurationManager()
{
ConnectionTimeout = TimeSpan.FromSeconds(110);
DisconnectTimeout = TimeSpan.FromSeconds(40);
HeartbeatInterval = TimeSpan.FromSeconds(10);
- KeepAlive = TimeSpan.FromSeconds(15);
+ KeepAlive = 2;
DefaultMessageBufferSize = 1000;
}
@@ -27,10 +30,21 @@ public TimeSpan DisconnectTimeout
set;
}
- public TimeSpan? KeepAlive
+ public int KeepAlive
{
- get;
- set;
+ get
+ {
+ return _keepAlive;
+ }
+ set
+ {
+ if (value < 0)
+ {
+ throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture, Resources.Error_KeepAliveMustBeGreaterThanZero));
+ }
+
+ _keepAlive = value;
+ }
}
public TimeSpan HeartbeatInterval
View
2  src/Microsoft.AspNet.SignalR.Core/Configuration/IConfigurationManager.cs
@@ -27,7 +27,7 @@ public interface IConfigurationManager
/// <summary>
/// Gets or sets a <see cref="TimeSpan"/> representing the amount of time to wait before sending a keep alive packet over an idle connection. Set to null to disable keep alive.
/// </summary>
- TimeSpan? KeepAlive { get; set; }
+ int KeepAlive { get; set; }
/// <summary>
/// Gets of sets the number of messages to buffer for a specific signal.
Please sign in to comment.
Something went wrong with that request. Please try again.