コード例 #1
0
        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
        }
コード例 #2
0
ファイル: WebAPI_Init.cs プロジェクト: Vita-Nex/Core
        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
        }