Пример #1
0
        public ResponseInfo ContextTimeout(Context context)
        {
            var response = new ResponseInfo(null, null);

            lock (_locker)
            {
                if (context == _waiting)
                {
                    response.Context = _waiting;
                    _waiting         = null;
                    if (_packets.Count > 0)
                    {
                        response.Packet = _packets.Peek();
                    }
                }
            }
            return(response);
        }
Пример #2
0
        public ResponseInfo FinishWaiting()
        {
            var response = new ResponseInfo(null, null);

            lock (_locker)
            {
                if (_waiting != null)
                {
                    response.Context = _waiting;
                    _waiting         = null;
                    if (_packets.Count > 0)
                    {
                        response.Packet = _packets.Peek();
                    }
                }
            }
            return(response);
        }
Пример #3
0
 private void Send(ResponseInfo response)
 {
     Send(response.Context, response.Packet);
 }