Example #1
0
 private void writeWorker()
 {
     _port.Open();
     while (Running)
     {
         if (_msgQueue.Count > 0)
         {
             PriorityMessage msg = _msgQueue.Dequeue();
             _port.Write(msg.Message);
             Thread.Sleep(msg.WaitTime);
         }
         else
         {
             Thread.Sleep(CheckDelay);
         }
     }
     _port.Close();
 }
Example #2
0
 public void Write(PriorityMessage msg)
 {
     _msgQueue.Enqueue(msg, msg.Priority);
 }