Exemplo n.º 1
0
 public bool AddClientTask(IRemoteTask whichtask)
 {
     if (m_enable)
     {
         m_waitingclienttasks.Enqueue(whichtask);
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 public IRemoteTask FetchAClientTask()
 {
     CheckAvailableClientTaskResource();
     lock (m_waitingclienttasks)
     {
         if (m_enable && m_waitingclienttasks.Count > 0)
         {
             IRemoteTask t = m_waitingclienttasks.Dequeue();
             return(t);
         }
         else
         {
             return(null);
         }
     }
 }
Exemplo n.º 3
0
 public bool SendbackAClientTask(IRemoteTask whichtask)
 {
     try
     {
         if (m_enable)
         {
             IRemoteTask t1 = whichtask.Clone() as IRemoteTask;
             m_taskmanager.AddProcessedTask(t1);
             return(true);
         }
         return(false);
     }
     catch (Exception e)
     {
         log.Error("Sending Back", e);
         return(false);
     }
 }
Exemplo n.º 4
0
 public static bool TTMSendBackATask(IRemoteTask task)
 {
     try
     {
         return(GetTaskTransmissionManager().SendbackAClientTask(task));
     }
     catch (System.Net.WebException e)
     {
         log.Error("连接远程服务器错误: " + e.Message);
         return(false);
     }
     catch (System.Net.Sockets.SocketException e)
     {
         log.Error("连接远程服务器错误: " + e.Message);
         return(false);
     }
     catch (Exception ee)
     {
         log.Error(ee);
         return(false);
     }
 }
 public bool AddClientTask(IRemoteTask whichtask)
 {
     if (m_enable)
     {
         m_waitingclienttasks.Enqueue(whichtask);
         return true;
     }
     return false;
 }
 public bool SendbackAClientTask(IRemoteTask whichtask)
 {
     try
     {
         if (m_enable)
         {
             IRemoteTask t1 = whichtask.Clone() as IRemoteTask;
             m_taskmanager.AddProcessedTask(t1);
             return true;
         }
         return false;
     }
     catch (Exception e)
     {
         log.Error("Sending Back", e);
         return false;
     }
 }
 public static bool TTMSendBackATask(IRemoteTask task)
 {
     try
     {
         return GetTaskTransmissionManager().SendbackAClientTask(task);
     }
     catch (System.Net.WebException e)
     {
         log.Error("连接远程服务器错误: " + e.Message);
         return false;
     }
     catch (System.Net.Sockets.SocketException e)
     {
         log.Error("连接远程服务器错误: " + e.Message);
         return false;
     }
     catch (Exception ee)
     {
         log.Error(ee);
         return false;
     }
 }