Esempio n. 1
0
        internal void AddResponse(Common.Net.Address address, CommandResponse response)
        {
            _type = response.Type;

            lock (_responseMutex)
            {
                if (_responses.ContainsKey(address))
                {
                    ResponseList responseList = _responses[address];
                    if (!responseList.IsComplete)
                    {
                        responseList.AddResponse(response);
                    }
                    else
                    {
                        if (_reRoutedAddress != null && !_reRoutedAddress.Equals(address))
                        {
                            if (!_responses.ContainsKey(_reRoutedAddress))
                            {
                                ResponseList rspList = new ResponseList();
                                if (!rspList.IsComplete)
                                {
                                    rspList.AddResponse(response);
                                }

                                _responses.Add(_reRoutedAddress, rspList);
                            }
                            else
                            {
                                responseList = _responses[_reRoutedAddress];
                                if (!responseList.IsComplete)
                                {
                                    responseList.AddResponse(response);
                                }
                            }
                        }
                    }
                }
            }
        }