static WebAPI() { CSOptions = new WebAPIOptions(); Clients = new List <WebAPIClient>(); Handlers = new Dictionary <string, WebAPIHandler>(); _ActivityTimer = PollTimer.FromSeconds( 60.0, () => { if (!_Listening || Listener == null || Listener.Server == null || !Listener.Server.IsBound) { _Listening = false; ListenerUtility.ListenAsync(); } Clients.RemoveAll(c => !c.Connected); }, () => Clients.Count > 0, false); ServicePointManager.SecurityProtocol = (SecurityProtocolType)0xFF0; // Ssl3, Tls, Tls11, Tls12 }
static WebAPI() { CSOptions = new WebAPIOptions(); Clients = new List<WebAPIClient>(); Handlers = new Dictionary<string, WebAPIHandler>(); _ActivityTimer = PollTimer.FromSeconds( 60.0, () => { if (!_Listening || Listener == null || Listener.Server == null || !Listener.Server.IsBound) { _Listening = false; ListenerUtility.ListenAsync(); } Clients.RemoveAll(c => !c.Connected); }, () => Clients.Count > 0, false); ServicePointManager.SecurityProtocol = (SecurityProtocolType)0xFF0; // Ssl3, Tls, Tls11, Tls12 }