private void ProcessQueue() { try { while (!processThreadAbort) { DebugMessage message = null; lock (queue) { // check if queue has requests or too many have already been sent if (queue.Count <= 0 || sent.Count > MaxSentQueue) { Thread.Sleep(5); continue; } message = queue.Dequeue(); } PrepareUnitTest(); message.CallBack = MessageCallBack; debugServerEngine.SendCommand(message); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public void SendMessageAndWait(DebugMessage message) { wait = true; message.CallBack = Acknowledge; debugServerEngine.SendCommand(message); while (wait) { Thread.Sleep(5); } }
private void toolStripButton4_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = "Sending Ping..."; DebugEngine.SendCommand(new DebugMessage(Codes.Ping, (byte[])null)); }
private void toolStripButton4_Click(object sender, EventArgs e) { toolStripStatusLabel1.Text = "Sent Ping!"; DebugEngine.SendCommand(new DebugMessage(DebugCode.Ping, new List <byte>())); }