コード例 #1
0
ファイル: PacketQueue.cs プロジェクト: if1live/hatsushimo
        public void Enqueue(Session s, byte[] d)
        {
            var pair = new DataPair()
            {
                Session = s,
                Data    = d,
            };

            queue.Enqueue(pair);
        }
コード例 #2
0
ファイル: PacketQueue.cs プロジェクト: if1live/hatsushimo
        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);
        }