Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made reconnect timeout configurable on SSE transport.

  • Loading branch information...
commit 6b869a4cd92ef5c93a1a16a087930026a6b3a6f4 1 parent f3829ea
David Fowler davidfowl authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 SignalR.Client/Transports/ServerSentEventsTransport.cs
9 SignalR.Client/Transports/ServerSentEventsTransport.cs
View
@@ -13,7 +13,6 @@ public class ServerSentEventsTransport : HttpBasedTransport
private int _initializedCalled;
private const string EventSourceKey = "eventSourceStream";
- private static readonly TimeSpan ReconnectDelay = TimeSpan.FromSeconds(2);
public ServerSentEventsTransport()
: this(new DefaultHttpClient())
@@ -23,14 +22,20 @@ public ServerSentEventsTransport()
public ServerSentEventsTransport(IHttpClient httpClient)
: base(httpClient, "serverSentEvents")
{
+ ReconnectDelay = TimeSpan.FromSeconds(2);
ConnectionTimeout = TimeSpan.FromSeconds(2);
}
/// <summary>
- /// Time allowed before failing the connect request
+ /// Time allowed before failing the connect request.
/// </summary>
public TimeSpan ConnectionTimeout { get; set; }
+ /// <summary>
+ /// The time to wait after a connection drops to try reconnecting.
+ /// </summary>
+ public TimeSpan ReconnectDelay { get; set; }
+
protected override void OnStart(IConnection connection, string data, Action initializeCallback, Action<Exception> errorCallback)
{
OpenConnection(connection, data, initializeCallback, errorCallback);
Please sign in to comment.
Something went wrong with that request. Please try again.