public Diagram GetDiagram()
 {
     Diagram result = new Diagram();
     result.needSend = false;
     queue.TryDequeue(out result);
     return result;
 }
예제 #2
0
 private void PrintDiagram(Diagram diag)
 {
     Char[] charOut = System.Text.Encoding.Default.GetChars(diag.DiagBody);
     log.Info(charOut);
     System.Console.WriteLine(charOut);
 }
예제 #3
0
 public Diagram Handle(Diagram diag)
 {
     PrintDiagram(diag);
     return diag;
 }
 public void ReceiveInData()
 {
     Diagram recDiag;
     Int32 receivedLength;
     while(receiving)
     {
         Monitor.Enter(inConnection);
         receivedLength = inConnection.Receive(receiveBuffer);
         Monitor.Exit(inConnection);
         recDiag = new Diagram(receivedLength, receiveBuffer);
         recDiag = handler.Handle(recDiag);
         if (recDiag.needSend)
         {
             receiveQueue.AddDiagram(recDiag);
         }
     }
 }
 public void AddDiagram(Diagram diag)
 {
     queue.Enqueue(diag);
 }