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); } }
public SpoolerResult SendSpoolerMessageRPC(RPCInvoker.RPC rpc_call) { return(SendSpoolerMessage(rpc_call.Serialize())); }