예제 #1
0
파일: SpoolerClient.cs 프로젝트: urish/M3D
 private void MessageThread()
 {
     try
     {
         while (!threadsAborted.Value)
         {
             var result = new RPCInvoker.RPC();
             var flag   = false;
             lock (queue_lock)
             {
                 try
                 {
                     if (message_queue.Count > 0)
                     {
                         flag = message_queue.TryDequeue(out result);
                     }
                 }
                 catch (Exception ex)
                 {
                     ErrorLogger.LogException("Exception in SpoolerClient.MessageThread " + ex.Message, ex);
                 }
             }
             if (flag)
             {
                 if (result.name.Contains("UpdatePrinterList"))
                 {
                     lock (queue_lock)
                     {
                         try
                         {
                             update_in_queue = false;
                         }
                         catch (Exception ex)
                         {
                             ErrorLogger.LogException("Exception in SpoolerClient.MessageThread 1 " + ex.Message, ex);
                         }
                     }
                 }
                 var num = (int)spooler_connection.SendSpoolerMessageInternal(result.Serialize());
             }
             else
             {
                 Thread.Sleep(50);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorLogger.LogException("Exception in SpoolerClient.MessageThread 2 " + ex.Message, ex);
     }
 }
예제 #2
0
파일: SpoolerClient.cs 프로젝트: urish/M3D
 public SpoolerResult SendSpoolerMessageRPC(RPCInvoker.RPC rpc_call)
 {
     return(SendSpoolerMessage(rpc_call.Serialize()));
 }