Esempio n. 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);
 }
Esempio n. 2
0
        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);
            }
        }