Skip to content
This repository
Browse code

Made reconnect timeout configurable on SSE transport.

  • Loading branch information...
commit 6b869a4cd92ef5c93a1a16a087930026a6b3a6f4 1 parent f3829ea
David Fowler authored July 22, 2012
9  SignalR.Client/Transports/ServerSentEventsTransport.cs
@@ -13,7 +13,6 @@ public class ServerSentEventsTransport : HttpBasedTransport
13 13
         private int _initializedCalled;
14 14
 
15 15
         private const string EventSourceKey = "eventSourceStream";
16  
-        private static readonly TimeSpan ReconnectDelay = TimeSpan.FromSeconds(2);
17 16
 
18 17
         public ServerSentEventsTransport()
19 18
             : this(new DefaultHttpClient())
@@ -23,14 +22,20 @@ public ServerSentEventsTransport()
23 22
         public ServerSentEventsTransport(IHttpClient httpClient)
24 23
             : base(httpClient, "serverSentEvents")
25 24
         {
  25
+            ReconnectDelay = TimeSpan.FromSeconds(2);
26 26
             ConnectionTimeout = TimeSpan.FromSeconds(2);
27 27
         }
28 28
 
29 29
         /// <summary>
30  
-        /// Time allowed before failing the connect request
  30
+        /// Time allowed before failing the connect request.
31 31
         /// </summary>
32 32
         public TimeSpan ConnectionTimeout { get; set; }
33 33
 
  34
+        /// <summary>
  35
+        /// The time to wait after a connection drops to try reconnecting.
  36
+        /// </summary>
  37
+        public TimeSpan ReconnectDelay { get; set; }
  38
+
34 39
         protected override void OnStart(IConnection connection, string data, Action initializeCallback, Action<Exception> errorCallback)
35 40
         {
36 41
             OpenConnection(connection, data, initializeCallback, errorCallback);

0 notes on commit 6b869a4

Please sign in to comment.
Something went wrong with that request. Please try again.