public void Add(Host host, LimitRule rule)
        {
            ITokenBucket ulBucket = null;
            ITokenBucket dlBucket = null;

            Remove(host);
            host.SetLimitRule(rule);

            if (rule.IsUploadLimited && !rule.IsUploadBlocked)
            {
                ulBucket = TokenBuckets.Construct()
                           .WithCapacity(rule.UploadRate.Value + (rule.UploadBurst ?? NetworkUtilities.GetDefaultBurst(rule.UploadRate.Value)))
                           .WithFixedIntervalRefillStrategy(rule.UploadRate.Value, TimeSpan.FromSeconds(1))
                           .Build();
            }

            if (rule.IsDownloadLimited && !rule.IsDownloadBlocked)
            {
                dlBucket = TokenBuckets.Construct()
                           .WithCapacity(rule.DownloadRate.Value + (rule.DownloadBurst ?? NetworkUtilities.GetDefaultBurst(rule.DownloadRate.Value)))
                           .WithFixedIntervalRefillStrategy(rule.DownloadRate.Value, TimeSpan.FromSeconds(1))
                           .Build();
            }

            if (ulBucket == null && dlBucket == null && !host.LimitRule.IsUploadBlocked && !host.LimitRule.IsDownloadBlocked)
            {
                return;
            }

            var buckets = new Tuple <ITokenBucket, ITokenBucket>(ulBucket, dlBucket);

            lock (_hostBucketDictLock) lock (_ipHostDict) lock (_bandwidthUploadDictLock) lock (_bandwidthDownloadDictLock)
                        {
                            _hostBucketDict.Add(host, buckets);
                            _ipHostDict.Add(IPAddress.Parse(host.IpAddress.ToString()), host);
                            _bandwidthUploadDict.Add(host, 0);
                            _bandwidthDownloadDict.Add(host, 0);
                        }
        }