diff --git a/Lidgren.Network/NetConnection.Reliability.cs b/Lidgren.Network/NetConnection.Reliability.cs index a3c84bf..5cbb5d8 100644 --- a/Lidgren.Network/NetConnection.Reliability.cs +++ b/Lidgren.Network/NetConnection.Reliability.cs @@ -185,6 +185,8 @@ namespace Lidgren.Network if (unfin <= 0) m_owner.Recycle(send.Message); // every sent has been acked; free the message + m_owner.LogVerbose("Received ack for " + tp + "#" + seqNr); + m_unackedSends.Remove(send); // TODO: recycle send diff --git a/Lidgren.Network/NetConnection.cs b/Lidgren.Network/NetConnection.cs index e2396a8..312de3a 100644 --- a/Lidgren.Network/NetConnection.cs +++ b/Lidgren.Network/NetConnection.cs @@ -176,6 +176,7 @@ namespace Lidgren.Network { if (now > send.NextResend) { + m_owner.LogVerbose("Resending " + send); m_unsentMessages.EnqueueFirst(send); send.SetNextResend(this); } @@ -356,6 +357,7 @@ namespace Lidgren.Network { m_owner.VerifyNetworkThread(); + m_owner.LogVerbose("Received over wire: " + mtp + "#" + channelSequenceNumber); try { NetDeliveryMethod ndm = NetPeer.GetDeliveryMethod(mtp); @@ -549,7 +551,7 @@ namespace Lidgren.Network im.m_senderEndpoint = m_remoteEndpoint; } - // m_owner.LogVerbose("Releasing " + im); + m_owner.LogVerbose("Releasing " + im); m_owner.ReleaseMessage(im); } @@ -588,6 +590,8 @@ namespace Lidgren.Network info.Received[nr] = true; info.TotalReceived++; + m_owner.LogVerbose("Got fragment " + nr + "/" + info.TotalFragmentCount + " (num received: " + info.TotalReceived + ")"); + return info.TotalReceived >= info.TotalFragmentCount; } @@ -649,9 +653,9 @@ namespace Lidgren.Network m_unsentMessages.Enqueue(send); } - public void SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method) + public bool SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method) { - SendMessage(msg, method, 0); + return SendMessage(msg, method, 0); } public bool SendMessage(NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel) diff --git a/Lidgren.Network/NetSending.cs b/Lidgren.Network/NetSending.cs index 2936860..0d3b9c1 100644 --- a/Lidgren.Network/NetSending.cs +++ b/Lidgren.Network/NetSending.cs @@ -46,5 +46,10 @@ namespace Lidgren.Network NextResend = NetTime.Now + totalDelay; } + + public override string ToString() + { + return "[NetSending " + MessageType + "#" + SequenceNumber + " NumSends: " + NumSends + "]"; + } } } diff --git a/Samples/ImageServer/Program.cs b/Samples/ImageServer/Program.cs index 1bace4c..283f92a 100644 --- a/Samples/ImageServer/Program.cs +++ b/Samples/ImageServer/Program.cs @@ -32,6 +32,8 @@ namespace ImageServer Server = new NetServer(config); + System.IO.File.Delete("C:\\tmp\\clientlog.txt"); + System.IO.File.Delete("C:\\tmp\\serverlog.txt"); Application.Idle += new EventHandler(AppLoop); Application.Run(MainForm);