Author: alanmc
Date: 2006-12-03 20:22:16 -0500 (Sun, 03 Dec 2006)
New Revision: 68926

Modified:
   trunk/bitsharp/src/MonoTorrent.Client/Managers/TorrentManager.cs
Log:
When queuing a keepalive message, reset the LastMessageSent time immediately.

Modified: trunk/bitsharp/src/MonoTorrent.Client/Managers/TorrentManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Client/Managers/TorrentManager.cs    
2006-12-04 01:20:35 UTC (rev 68925)
+++ trunk/bitsharp/src/MonoTorrent.Client/Managers/TorrentManager.cs    
2006-12-04 01:22:16 UTC (rev 68926)
@@ -471,8 +471,11 @@
                             id.Peer.Connection.EnQueue(msg);
                             id.Peer.Connection.AmRequestingPiecesCount++;
                         }
-                        if((DateTime.Now - id.Peer.Connection.LastMessageSent 
> new TimeSpan(0,0,90)))
+                        if ((DateTime.Now - id.Peer.Connection.LastMessageSent 
> new TimeSpan(0, 0, 90)))
+                        {
+                            id.Peer.Connection.LastMessageSent = DateTime.Now;
                             id.Peer.Connection.EnQueue(new KeepAliveMessage());
+                        }
 
                         if ((DateTime.Now - 
id.Peer.Connection.LastMessageReceived > new TimeSpan(0, 0, 120)))
                         {

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

Reply via email to