public Diagram GetDiagram() { Diagram result = new Diagram(); result.needSend = false; queue.TryDequeue(out result); return result; }
private void PrintDiagram(Diagram diag) { Char[] charOut = System.Text.Encoding.Default.GetChars(diag.DiagBody); log.Info(charOut); System.Console.WriteLine(charOut); }
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); }