コード例 #1
0
 protected WebProxy GetProxy()
 {
     if (SendCacheStore.GetSystemValue("proxyenable") == "true")
     {
         var proxyurl = SendCacheStore.GetSystemValue("proxy");
         if (proxyurl != null)
         {
             WebProxy proxy = new WebProxy
             {
                 Address = new Uri(proxyurl)
             };
             return(proxy);
         }
     }
     return(null);
 }
コード例 #2
0
ファイル: SendTaskManager.cs プロジェクト: next-9527/inotify
        public void Run()
        {
            var sendthread = SendCacheStore.GetSystemValue("sendthread");

            int.TryParse(sendthread, out int threadCount);
            threadCount = threadCount <= 0 ? 1 : threadCount;
            for (int i = 0; i < threadCount; i++)
            {
                Thread thread = null;
                thread = new Thread(e => { SendWork(thread); })
                {
                    IsBackground = true,
                    Priority     = ThreadPriority.Highest
                };
                thread.Start();
                m_sendThreads.Add(thread);
            }
        }