public bool IsSequenceNumberValid(ReceivedTransportMessage data, bool syncProcessorInitialized)
        {
            var transportMessageSequenceNumber = data.SequenceNumber;
            if (!transportMessageSequenceNumber.HasValue)
                return true;
            var peerKey = new PeerTransportKey(data.PeerId, data.Endpoint);
            int currentSeqNum;
            if (!_sequenceNumber.TryGetValue(peerKey, out currentSeqNum))
            {
                _sequenceNumber.Add(peerKey, -1);
                currentSeqNum = -1;
            }
            if (syncProcessorInitialized)
            {
                if (_peerConfiguration.PeerId != peerKey.Peer)
                {
                    if (transportMessageSequenceNumber != (currentSeqNum + 1))
                    {
                        _logger.Info(string.Format("missed message from endpoint {3} from peer {0} from sequence number {1} to {2}",
                                          peerKey.Peer,
                                          currentSeqNum + 1,
                                          transportMessageSequenceNumber,
                                          peerKey.Endpoint));
            #if DEBUG
                        Debugger.Break();
                        //we missed a message
            #endif
                        return false;
                    }

                    _sequenceNumber[peerKey] = transportMessageSequenceNumber.Value;
                }
            }
            else
            {
                _sequenceNumber[peerKey] = transportMessageSequenceNumber.Value;
            }
            return true;
        }
 public bool Equals(PeerTransportKey other)
 {
     return string.Equals(Peer, other.Peer) && Equals(Endpoint, other.Endpoint);
 }