Author: alanmc
Date: 2006-12-03 20:20:35 -0500 (Sun, 03 Dec 2006)
New Revision: 68925
Modified:
trunk/bitsharp/src/MonoTorrent.Client/Managers/ConnectionManager.cs
Log:
Reordered statement execution to avoid a NullReferenceException that was caused
every time the Async beginrecevice completed synchronously. That was annoying
me for ages! I only just realised what was happening!
Modified: trunk/bitsharp/src/MonoTorrent.Client/Managers/ConnectionManager.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Client/Managers/ConnectionManager.cs
2006-12-04 01:11:33 UTC (rev 68924)
+++ trunk/bitsharp/src/MonoTorrent.Client/Managers/ConnectionManager.cs
2006-12-04 01:20:35 UTC (rev 68925)
@@ -469,11 +469,11 @@
//id.Peer.MessageHistory.AppendLine(DateTime.Now.ToLongTimeString() +
"BitfieldMessage");
ClientEngine.BufferManager.FreeBuffer(ref
id.Peer.Connection.sendBuffer);
ClientEngine.BufferManager.GetBuffer(ref
id.Peer.Connection.recieveBuffer, BufferType.SmallMessageBuffer);
+ id.Peer.Connection.ProcessingQueue = false;
id.Peer.Connection.BytesReceived = 0;
id.Peer.Connection.BytesToRecieve = 4;
id.Peer.Connection.BeginReceive(id.Peer.Connection.recieveBuffer, 0,
id.Peer.Connection.BytesToRecieve, SocketFlags.None, peerMessageLengthReceived,
id, out id.ErrorCode);
- id.Peer.Connection.ProcessingQueue = false;
}
}
catch (SocketException ex)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches