public void Enqueue(Session s, byte[] d) { var pair = new DataPair() { Session = s, Data = d, }; queue.Enqueue(pair); }
public bool TryDequeue(out Session s, out byte[] d) { s = null; d = null; DataPair pair = new DataPair(); var found = queue.TryDequeue(out pair); if (found) { s = pair.Session; d = pair.Data; } return(found); }