Beispiel #1
0
        public void DoCallback()
        {
            lock (this)
            {
                while (_receivedPackets.Count() > 0)
                {
                    SecurePacket          packet = _receivedPackets.Dequeue();
                    Int32                 key    = packet.SeqNo;
                    Action <SecurePacket> callback;


                    packet.SkipHeader();
                    if (_callbacks.TryGetValue(key, out callback) == true)
                    {
                        if (callback != null)
                        {
                            callback(packet);
                        }
                        _callbacks.Remove(key);
                    }
                }
            }
        }
Beispiel #2
0
 public Response(SecurePacket packet)
 {
     Packet = packet;
     Packet.SkipHeader();
     ResultCodeNo = packet.GetInt32();
 }