Author: alanmc
Date: 2006-10-12 13:24:12 -0400 (Thu, 12 Oct 2006)
New Revision: 66618

Modified:
   trunk/bitsharp/src/TestClient/main.cs
Log:
Bugfix for WaitHandle.WaitAll() and misc cleanup

Modified: trunk/bitsharp/src/TestClient/main.cs
===================================================================
--- trunk/bitsharp/src/TestClient/main.cs       2006-10-12 17:21:49 UTC (rev 
66617)
+++ trunk/bitsharp/src/TestClient/main.cs       2006-10-12 17:24:12 UTC (rev 
66618)
@@ -128,11 +128,8 @@
         {
 #warning Maybe return a wait handle and wait for the response.
             WaitHandle[] handles = engine.Stop();
-            int a = Environment.TickCount;
-            WaitHandle.WaitAll(handles);
-            Console.WriteLine(Environment.TickCount - a);
-            Console.ReadLine(); Console.ReadLine(); Console.ReadLine(); 
Console.ReadLine();
-
+            if (handles != null)
+                WaitHandle.WaitAll(handles);
             foreach (TraceListener lst in Debug.Listeners)
             {
                 lst.Flush();
@@ -242,9 +239,9 @@
         {
             ITorrentManager manager = (ITorrentManager)sender;
             if (e.HashPassed)
-                Debug.WriteLine("Hash Passed: " + manager.Torrent.Name + " " + 
e.PieceIndex);
+                Debug.WriteLine("Hash Passed: " + manager.Torrent.Name + " " + 
e.PieceIndex + "/" + manager.Torrent.Pieces.Length);
             else
-                Debug.WriteLine("Hash Failed: " + manager.Torrent.Name + " " + 
e.PieceIndex);
+                Debug.WriteLine("Hash Failed: " + manager.Torrent.Name + " " + 
e.PieceIndex + "/" + manager.Torrent.Pieces.Length);
         }
         #endregion
     }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to