private TimeSpan GetPollingInterval() { switch (this.pollingMode) { case PollingMode.Idle: return(Ticks.ToTimeSpan(Ticks.FromTimeSpan(base.Settings.InactivityTimeout) / 2L)); case PollingMode.KeepAlive: return(WsrmUtilities.CalculateKeepAliveInterval(base.Settings.InactivityTimeout, base.Settings.MaxRetryCount)); case PollingMode.FastPolling: { TimeSpan span = WsrmUtilities.CalculateKeepAliveInterval(base.Settings.InactivityTimeout, base.Settings.MaxRetryCount); TimeSpan span2 = Ticks.ToTimeSpan(Ticks.FromTimeSpan(this.binder.DefaultSendTimeout) / 2L); if (span2 >= span) { return(span); } return(span2); } case PollingMode.NotPolling: return(TimeSpan.MaxValue); } throw Fx.AssertAndThrow("Unknown polling mode."); }
TimeSpan GetPollingInterval() { switch (this.pollingMode) { case PollingMode.Idle: return(Ticks.ToTimeSpan(Ticks.FromTimeSpan(this.Settings.InactivityTimeout) / 2)); case PollingMode.KeepAlive: return(WsrmUtilities.CalculateKeepAliveInterval(this.Settings.InactivityTimeout, this.Settings.MaxRetryCount)); case PollingMode.NotPolling: return(TimeSpan.MaxValue); case PollingMode.FastPolling: TimeSpan keepAliveInterval = WsrmUtilities.CalculateKeepAliveInterval(this.Settings.InactivityTimeout, this.Settings.MaxRetryCount); TimeSpan fastPollingInterval = Ticks.ToTimeSpan(Ticks.FromTimeSpan(this.binder.DefaultSendTimeout) / 2); if (fastPollingInterval < keepAliveInterval) { return(fastPollingInterval); } else { return(keepAliveInterval); } default: throw Fx.AssertAndThrow("Unknown polling mode."); } }