From ad90dc635fb65652a7e4d334d37adba575f7feb8 Mon Sep 17 00:00:00 2001 From: ZhangKong <602488225@qq.com> Date: Tue, 11 Jul 2017 01:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DHTSpider.Test/NLog.config | 19 +++++++++++++++++-- DHTSpider.Test/Spider.cs | 11 ++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/DHTSpider.Test/NLog.config b/DHTSpider.Test/NLog.config index 75cf03a..fd5d3b0 100644 --- a/DHTSpider.Test/NLog.config +++ b/DHTSpider.Test/NLog.config @@ -28,8 +28,17 @@ --> - + + @@ -40,5 +49,11 @@ --> + diff --git a/DHTSpider.Test/Spider.cs b/DHTSpider.Test/Spider.cs index cac5f4c..bdf2194 100644 --- a/DHTSpider.Test/Spider.cs +++ b/DHTSpider.Test/Spider.cs @@ -93,7 +93,7 @@ namespace DHTSpider.Test { if (Filter == null || (Filter != null && Filter.Ignore(infohash))) { - //Logger.Info($"InfoHash:{infohash} Address:{endpoint.Address} Port:{endpoint.Port}"); + Logger.Info($"InfoHash:{infohash} Address:{endpoint.Address} Port:{endpoint.Port}"); NewMetadata?.Invoke(this, new NewMetadataEventArgs(infohash, endpoint)); Queue.Enqueue(new KeyValuePair(infohash, endpoint)); } @@ -171,6 +171,15 @@ namespace DHTSpider.Test { Download(); }); + + Task.Run(() => + { + while (true) + { + Logger.Success($"Queue:{Queue.Count}"); + Thread.Sleep(5000); + } + }); } public void Stop() {