public void Dispatch() { for (int i = 0; i < 30; i++) { if (dispatchQueue.Count > 0) { DispatchData data = dispatchQueue.Dequeue(); data.action(data); } else { break; } } }
public void Enqueue(Delegate a, PacketHeader p, Connection c, MessageData m) { DispatchData data = new DispatchData((Action <DispatchData>)a, p, c, m); dispatchQueue.Enqueue(data); }