Beispiel #1
0
        /// <summary>
        /// 加载资源
        /// </summary>
        static RequestQueue()
        {
            var one = new ServerResource("192.168.1.1", 8000);
            var two = new ServerResource("192.168.1.2", 8000);

            AddServerResource(one);
            AddServerResource(two);
        }
Beispiel #2
0
 /// <summary>
 /// 请求线程
 /// </summary>
 private void RequestInBackground()
 {
     try
     {
         RequestInfo    request  = this.GetRequest();
         ServerResource resource = this.GetReource();
         resource.GetRequest(request, this);
     }
     catch (System.Exception ex)
     {
         LogService.WriteLog(ex, "RequestQueue_RequestInBackground");
     }
 }
Beispiel #3
0
 /// <summary>
 /// 添加资源
 /// </summary>
 /// <param name="serverResource">资源</param>
 public static void AddServerResource(ServerResource serverResource)
 {
     resourceQueue.Enqueue(serverResource);
 }