From: JamJar00 Date: Mon, 19 Dec 2016 18:02:37 +0000 (+0000) Subject: Remade statistics and removed from unit tests X-Git-Tag: 1.0.0~118 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=09c200b03f4435159c9d8f7214a9f6f3b2e67233;p=rhonda%2Fimpostor.hazel.git Remade statistics and removed from unit tests --- diff --git a/Hazel.UnitTests/Hazel.UnitTests.csproj b/Hazel.UnitTests/Hazel.UnitTests.csproj index 466c334..a380240 100644 --- a/Hazel.UnitTests/Hazel.UnitTests.csproj +++ b/Hazel.UnitTests/Hazel.UnitTests.csproj @@ -46,11 +46,14 @@ - + + False + + diff --git a/Hazel.UnitTests/StatisticsTests.cs b/Hazel.UnitTests/StatisticsTests.cs new file mode 100644 index 0000000..2afd179 --- /dev/null +++ b/Hazel.UnitTests/StatisticsTests.cs @@ -0,0 +1,161 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Hazel.UnitTests +{ + [TestClass] + public class StatisticsTests + { + [TestMethod] + public void SendTests() + { + ConnectionStatistics statistics = new ConnectionStatistics(); + + statistics.LogUnreliableSend(10, 11); + + Assert.AreEqual(1, statistics.MessagesSent); + Assert.AreEqual(1, statistics.UnreliableMessagesSent); + Assert.AreEqual(0, statistics.ReliableMessagesSent); + Assert.AreEqual(0, statistics.FragmentedMessagesSent); + Assert.AreEqual(0, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(0, statistics.HelloMessagesSent); + + Assert.AreEqual(10, statistics.DataBytesSent); + Assert.AreEqual(11, statistics.TotalBytesSent); + + statistics.LogReliableSend(5, 8); + + Assert.AreEqual(2, statistics.MessagesSent); + Assert.AreEqual(1, statistics.UnreliableMessagesSent); + Assert.AreEqual(1, statistics.ReliableMessagesSent); + Assert.AreEqual(0, statistics.FragmentedMessagesSent); + Assert.AreEqual(0, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(0, statistics.HelloMessagesSent); + + Assert.AreEqual(15, statistics.DataBytesSent); + Assert.AreEqual(19, statistics.TotalBytesSent); + + statistics.LogFragmentedSend(6, 10); + + Assert.AreEqual(3, statistics.MessagesSent); + Assert.AreEqual(1, statistics.UnreliableMessagesSent); + Assert.AreEqual(1, statistics.ReliableMessagesSent); + Assert.AreEqual(1, statistics.FragmentedMessagesSent); + Assert.AreEqual(0, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(0, statistics.HelloMessagesSent); + + Assert.AreEqual(21, statistics.DataBytesSent); + Assert.AreEqual(29, statistics.TotalBytesSent); + + statistics.LogAcknowledgementSend(4); + + Assert.AreEqual(4, statistics.MessagesSent); + Assert.AreEqual(1, statistics.UnreliableMessagesSent); + Assert.AreEqual(1, statistics.ReliableMessagesSent); + Assert.AreEqual(1, statistics.FragmentedMessagesSent); + Assert.AreEqual(1, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(0, statistics.HelloMessagesSent); + + Assert.AreEqual(21, statistics.DataBytesSent); + Assert.AreEqual(33, statistics.TotalBytesSent); + + statistics.LogHelloSend(7); + + Assert.AreEqual(5, statistics.MessagesSent); + Assert.AreEqual(1, statistics.UnreliableMessagesSent); + Assert.AreEqual(1, statistics.ReliableMessagesSent); + Assert.AreEqual(1, statistics.FragmentedMessagesSent); + Assert.AreEqual(1, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(1, statistics.HelloMessagesSent); + + Assert.AreEqual(21, statistics.DataBytesSent); + Assert.AreEqual(40, statistics.TotalBytesSent); + + Assert.AreEqual(0, statistics.MessagesReceived); + Assert.AreEqual(0, statistics.UnreliableMessagesReceived); + Assert.AreEqual(0, statistics.ReliableMessagesReceived); + Assert.AreEqual(0, statistics.FragmentedMessagesReceived); + Assert.AreEqual(0, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(0, statistics.HelloMessagesReceived); + + Assert.AreEqual(0, statistics.DataBytesReceived); + Assert.AreEqual(0, statistics.TotalBytesReceived); + } + + [TestMethod] + public void ReceiveTests() + { + ConnectionStatistics statistics = new ConnectionStatistics(); + + statistics.LogUnreliableReceive(10, 11); + + Assert.AreEqual(1, statistics.MessagesReceived); + Assert.AreEqual(1, statistics.UnreliableMessagesReceived); + Assert.AreEqual(0, statistics.ReliableMessagesReceived); + Assert.AreEqual(0, statistics.FragmentedMessagesReceived); + Assert.AreEqual(0, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(0, statistics.HelloMessagesReceived); + + Assert.AreEqual(10, statistics.DataBytesReceived); + Assert.AreEqual(11, statistics.TotalBytesReceived); + + statistics.LogReliableReceive(5, 8); + + Assert.AreEqual(2, statistics.MessagesReceived); + Assert.AreEqual(1, statistics.UnreliableMessagesReceived); + Assert.AreEqual(1, statistics.ReliableMessagesReceived); + Assert.AreEqual(0, statistics.FragmentedMessagesReceived); + Assert.AreEqual(0, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(0, statistics.HelloMessagesReceived); + + Assert.AreEqual(15, statistics.DataBytesReceived); + Assert.AreEqual(19, statistics.TotalBytesReceived); + + statistics.LogFragmentedReceive(6, 10); + + Assert.AreEqual(3, statistics.MessagesReceived); + Assert.AreEqual(1, statistics.UnreliableMessagesReceived); + Assert.AreEqual(1, statistics.ReliableMessagesReceived); + Assert.AreEqual(1, statistics.FragmentedMessagesReceived); + Assert.AreEqual(0, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(0, statistics.HelloMessagesReceived); + + Assert.AreEqual(21, statistics.DataBytesReceived); + Assert.AreEqual(29, statistics.TotalBytesReceived); + + statistics.LogAcknowledgementReceive(4); + + Assert.AreEqual(4, statistics.MessagesReceived); + Assert.AreEqual(1, statistics.UnreliableMessagesReceived); + Assert.AreEqual(1, statistics.ReliableMessagesReceived); + Assert.AreEqual(1, statistics.FragmentedMessagesReceived); + Assert.AreEqual(1, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(0, statistics.HelloMessagesReceived); + + Assert.AreEqual(21, statistics.DataBytesReceived); + Assert.AreEqual(33, statistics.TotalBytesReceived); + + statistics.LogHelloReceive(7); + + Assert.AreEqual(5, statistics.MessagesReceived); + Assert.AreEqual(1, statistics.UnreliableMessagesReceived); + Assert.AreEqual(1, statistics.ReliableMessagesReceived); + Assert.AreEqual(1, statistics.FragmentedMessagesReceived); + Assert.AreEqual(1, statistics.AcknowledgementMessagesReceived); + Assert.AreEqual(1, statistics.HelloMessagesReceived); + + Assert.AreEqual(21, statistics.DataBytesReceived); + Assert.AreEqual(40, statistics.TotalBytesReceived); + + Assert.AreEqual(0, statistics.MessagesSent); + Assert.AreEqual(0, statistics.UnreliableMessagesSent); + Assert.AreEqual(0, statistics.ReliableMessagesSent); + Assert.AreEqual(0, statistics.FragmentedMessagesSent); + Assert.AreEqual(0, statistics.AcknowledgementMessagesSent); + Assert.AreEqual(0, statistics.HelloMessagesSent); + + Assert.AreEqual(0, statistics.DataBytesSent); + Assert.AreEqual(0, statistics.TotalBytesSent); + } + } +} diff --git a/Hazel.UnitTests/TestHelper.cs b/Hazel.UnitTests/TestHelper.cs index 87091fc..a66dc6f 100644 --- a/Hazel.UnitTests/TestHelper.cs +++ b/Hazel.UnitTests/TestHelper.cs @@ -25,13 +25,7 @@ namespace Hazel.UnitTests //Setup listener listener.NewConnection += delegate(object sender, NewConnectionEventArgs args) { - Assert.AreEqual(0, args.Connection.Statistics.DataBytesReceived); - Assert.AreEqual(0, args.Connection.Statistics.TotalBytesReceived); - args.Connection.SendBytes(data, sendOption); - - Assert.AreEqual(data.Length, args.Connection.Statistics.DataBytesSent); - Assert.AreEqual(data.Length + headerSize, args.Connection.Statistics.TotalBytesSent); }; listener.Start(); @@ -55,11 +49,6 @@ namespace Hazel.UnitTests //Wait until data is received mutex.WaitOne(); - - Assert.AreEqual(1, connection.Statistics.DataBytesSent); - Assert.AreEqual(data.Length, connection.Statistics.DataBytesReceived); - Assert.AreEqual(totalHandshakeSize, connection.Statistics.TotalBytesSent); - Assert.AreEqual(data.Length + headerSize, connection.Statistics.TotalBytesReceived); } /// @@ -88,11 +77,6 @@ namespace Hazel.UnitTests Assert.AreEqual(sendOption, innerArgs.SendOption); - Assert.AreEqual(0, args.Connection.Statistics.DataBytesSent); - Assert.AreEqual(data.Length, args.Connection.Statistics.DataBytesReceived); - Assert.AreEqual(0, args.Connection.Statistics.TotalBytesSent); - Assert.AreEqual(data.Length + headerSize, args.Connection.Statistics.TotalBytesReceived); - mutex2.Set(); }; @@ -110,11 +94,6 @@ namespace Hazel.UnitTests //Wait until data is received mutex2.WaitOne(); - - Assert.AreEqual(data.Length + 1, connection.Statistics.DataBytesSent); - Assert.AreEqual(0, connection.Statistics.DataBytesReceived); - Assert.AreEqual(totalHandshakeSize + data.Length + headerSize, connection.Statistics.TotalBytesSent); - Assert.AreEqual(0, connection.Statistics.TotalBytesReceived); } /// diff --git a/Hazel/ConnectionStatistics.cs b/Hazel/ConnectionStatistics.cs index 85f40e7..be8770e 100644 --- a/Hazel/ConnectionStatistics.cs +++ b/Hazel/ConnectionStatistics.cs @@ -14,25 +14,120 @@ namespace Hazel public class ConnectionStatistics { /// - /// The number of messages sent. + /// The total number of messages sent. + /// + public long MessagesSent + { + get + { + return UnreliableMessagesSent + ReliableMessagesSent + FragmentedMessagesSent + AcknowledgementMessagesSent + HelloMessagesSent; + } + } + + /// + /// The number of unreliable messages sent. /// /// - /// This is the number of messages that were sent from the , incremented each time that - /// LogSend is called by the Connection. Messages that caused an error are not counted and messages are only - /// counted once all other operations in the send are complete. + /// This is the number of unreliable messages that were sent from the , incremented + /// each time that LogUnreliableSend is called by the Connection. Messages that caused an error are not + /// counted and messages are only counted once all other operations in the send are complete. /// - public long MessagesSent + public long UnreliableMessagesSent + { + get + { + return Interlocked.Read(ref unreliableMessagesSent); + } + } + + /// + /// The number of unreliable messages sent. + /// + long unreliableMessagesSent; + + /// + /// The number of reliable messages sent. + /// + /// + /// This is the number of reliable messages that were sent from the , incremented + /// each time that LogReliableSend is called by the Connection. Messages that caused an error are not + /// counted and messages are only counted once all other operations in the send are complete. + /// + public long ReliableMessagesSent + { + get + { + return Interlocked.Read(ref reliableMessagesSent); + } + } + + /// + /// The number of unreliable messages sent. + /// + long reliableMessagesSent; + + /// + /// The number of fragmented messages sent. + /// + /// + /// This is the number of fragmented messages that were sent from the , incremented + /// each time that LogFragmentedSend is called by the Connection. Messages that caused an error are not + /// counted and messages are only counted once all other operations in the send are complete. + /// + public long FragmentedMessagesSent + { + get + { + return Interlocked.Read(ref fragmentedMessagesSent); + } + } + + /// + /// The number of fragmented messages sent. + /// + long fragmentedMessagesSent; + + /// + /// The number of acknowledgement messages sent. + /// + /// + /// This is the number of acknowledgements that were sent from the , incremented + /// each time that LogAcknowledgementSend is called by the Connection. Messages that caused an error are not + /// counted and messages are only counted once all other operations in the send are complete. + /// + public long AcknowledgementMessagesSent + { + get + { + return Interlocked.Read(ref acknowledgementMessagesSent); + } + } + + /// + /// The number of acknowledgement messages sent. + /// + long acknowledgementMessagesSent; + + /// + /// The number of hello messages sent. + /// + /// + /// This is the number of hello messages that were sent from the , incremented + /// each time that LogHelloSend is called by the Connection. Messages that caused an error are not + /// counted and messages are only counted once all other operations in the send are complete. + /// + public long HelloMessagesSent { get { - return Interlocked.Read(ref messagesSent); + return Interlocked.Read(ref helloMessagesSent); } } /// - /// The number of messages sent. + /// The number of hello messages sent. /// - long messagesSent; + long helloMessagesSent; /// /// The number of bytes of data sent. @@ -88,24 +183,115 @@ namespace Hazel long totalBytesSent; /// - /// The number of messages received. + /// The total number of messages received. + /// + public long MessagesReceived + { + get + { + return UnreliableMessagesReceived + ReliableMessagesReceived + FragmentedMessagesReceived + AcknowledgementMessagesReceived + helloMessagesReceived; + } + } + + /// + /// The number of unreliable messages received. /// /// - /// This is the number of messages that were received by the , incremented each time that - /// LogReceive is called by the Connection. Messages are counted before the receive event is invoked. + /// This is the number of unreliable messages that were received by the , incremented + /// each time that LogUnreliableReceive is called by the Connection. Messages are counted before the receive event is invoked. /// - public long MessagesReceived + public long UnreliableMessagesReceived { get { - return Interlocked.Read(ref messagesReceived); + return Interlocked.Read(ref unreliableMessagesReceived); } } /// - /// The number of messages received. + /// The number of unreliable messages received. /// - long messagesReceived; + long unreliableMessagesReceived; + + /// + /// The number of reliable messages received. + /// + /// + /// This is the number of reliable messages that were received by the , incremented + /// each time that LogReliableReceive is called by the Connection. Messages are counted before the receive event is invoked. + /// + public long ReliableMessagesReceived + { + get + { + return Interlocked.Read(ref reliableMessagesReceived); + } + } + + /// + /// The number of reliable messages received. + /// + long reliableMessagesReceived; + + /// + /// The number of fragmented messages received. + /// + /// + /// This is the number of fragmented messages that were received by the , incremented + /// each time that LogFragmentedReceive is called by the Connection. Messages are counted before the receive event is invoked. + /// + public long FragmentedMessagesReceived + { + get + { + return Interlocked.Read(ref fragmentedMessagesReceived); + } + } + + /// + /// The number of fragmented messages received. + /// + long fragmentedMessagesReceived; + + /// + /// The number of acknowledgement messages received. + /// + /// + /// This is the number of acknowledgement messages that were received by the , incremented + /// each time that LogAcknowledgemntReceive is called by the Connection. Messages are counted before the receive event is invoked. + /// + public long AcknowledgementMessagesReceived + { + get + { + return Interlocked.Read(ref acknowledgementMessagesReceived); + } + } + + /// + /// The number of acknowledgement messages received. + /// + long acknowledgementMessagesReceived; + + /// + /// The number of hello messages received. + /// + /// + /// This is the number of hello messages that were received by the , incremented + /// each time that LogHelloReceive is called by the Connection. Messages are counted before the receive event is invoked. + /// + public long HelloMessagesReceived + { + get + { + return Interlocked.Read(ref helloMessagesReceived); + } + } + + /// + /// The number of hello messages received. + /// + long helloMessagesReceived; /// /// The number of bytes of data received. @@ -160,33 +346,145 @@ namespace Hazel long totalBytesReceived; /// - /// Logs the sending of a data packet in the statistics. + /// Logs the sending of an unreliable data packet in the statistics. /// /// The number of bytes of data sent. /// The total number of bytes sent. /// /// This should be called after the data has been sent and should only be called for data that is sent sucessfully. /// - internal void LogSend(int dataLength, int totalLength) + internal void LogUnreliableSend(int dataLength, int totalLength) { - Interlocked.Increment(ref messagesSent); + Interlocked.Increment(ref unreliableMessagesSent); Interlocked.Add(ref dataBytesSent, dataLength); Interlocked.Add(ref totalBytesSent, totalLength); } /// - /// Logs the receiving of a data packet in the statistics. + /// Logs the sending of a reliable data packet in the statistics. + /// + /// The number of bytes of data sent. + /// The total number of bytes sent. + /// + /// This should be called after the data has been sent and should only be called for data that is sent sucessfully. + /// + internal void LogReliableSend(int dataLength, int totalLength) + { + Interlocked.Increment(ref reliableMessagesSent); + Interlocked.Add(ref dataBytesSent, dataLength); + Interlocked.Add(ref totalBytesSent, totalLength); + } + + /// + /// Logs the sending of a fragmented data packet in the statistics. + /// + /// The number of bytes of data sent. + /// The total number of bytes sent. + /// + /// This should be called after the data has been sent and should only be called for data that is sent sucessfully. + /// + internal void LogFragmentedSend(int dataLength, int totalLength) + { + Interlocked.Increment(ref fragmentedMessagesSent); + Interlocked.Add(ref dataBytesSent, dataLength); + Interlocked.Add(ref totalBytesSent, totalLength); + } + + /// + /// Logs the sending of a acknowledgement data packet in the statistics. + /// + /// The total number of bytes sent. + /// + /// This should be called after the data has been sent and should only be called for data that is sent sucessfully. + /// + internal void LogAcknowledgementSend(int totalLength) + { + Interlocked.Increment(ref acknowledgementMessagesSent); + Interlocked.Add(ref totalBytesSent, totalLength); + } + + /// + /// Logs the sending of a hellp data packet in the statistics. + /// + /// The total number of bytes sent. + /// + /// This should be called after the data has been sent and should only be called for data that is sent sucessfully. + /// + internal void LogHelloSend(int totalLength) + { + Interlocked.Increment(ref helloMessagesSent); + Interlocked.Add(ref totalBytesSent, totalLength); + } + + /// + /// Logs the receiving of an unreliable data packet in the statistics. + /// + /// The number of bytes of data received. + /// The total number of bytes received. + /// + /// This should be called before the received event is invoked so it is up to date for subscribers to that event. + /// + internal void LogUnreliableReceive(int dataLength, int totalLength) + { + Interlocked.Increment(ref unreliableMessagesReceived); + Interlocked.Add(ref dataBytesReceived, dataLength); + Interlocked.Add(ref totalBytesReceived, totalLength); + } + + /// + /// Logs the receiving of a reliable data packet in the statistics. + /// + /// The number of bytes of data received. + /// The total number of bytes received. + /// + /// This should be called before the received event is invoked so it is up to date for subscribers to that event. + /// + internal void LogReliableReceive(int dataLength, int totalLength) + { + Interlocked.Increment(ref reliableMessagesReceived); + Interlocked.Add(ref dataBytesReceived, dataLength); + Interlocked.Add(ref totalBytesReceived, totalLength); + } + + /// + /// Logs the receiving of a fragmented data packet in the statistics. /// /// The number of bytes of data received. /// The total number of bytes received. /// /// This should be called before the received event is invoked so it is up to date for subscribers to that event. /// - internal void LogReceive(int dataLength, int totalLength) + internal void LogFragmentedReceive(int dataLength, int totalLength) { - Interlocked.Increment(ref messagesReceived); + Interlocked.Increment(ref fragmentedMessagesReceived); Interlocked.Add(ref dataBytesReceived, dataLength); Interlocked.Add(ref totalBytesReceived, totalLength); } + + /// + /// Logs the receiving of an acknowledgement data packet in the statistics. + /// + /// The total number of bytes received. + /// + /// This should be called before the received event is invoked so it is up to date for subscribers to that event. + /// + internal void LogAcknowledgementReceive(int totalLength) + { + Interlocked.Increment(ref acknowledgementMessagesReceived); + Interlocked.Add(ref totalBytesReceived, totalLength); + } + + /// + /// Logs the receiving of a hello data packet in the statistics. + /// + /// The total number of bytes received. + /// + /// This should be called before the received event is invoked so it is up to date for subscribers to that event. + /// + internal void LogHelloReceive(int totalLength) + { + Interlocked.Increment(ref helloMessagesReceived); + Interlocked.Add(ref totalBytesReceived, totalLength); + } } } diff --git a/Hazel/Properties/AssemblyInfo.cs b/Hazel/Properties/AssemblyInfo.cs index d03fb6b..a4db5c6 100644 --- a/Hazel/Properties/AssemblyInfo.cs +++ b/Hazel/Properties/AssemblyInfo.cs @@ -37,3 +37,6 @@ using System.Runtime.InteropServices; // NuGet version information [assembly: AssemblyInformationalVersion("0.0.0-beta")] + +// Show internals to unit testing assembly so it can test +[assembly:InternalsVisibleTo("Hazel.UnitTests")] \ No newline at end of file diff --git a/Hazel/Tcp/TcpConnection.cs b/Hazel/Tcp/TcpConnection.cs index c641907..99d60c1 100644 --- a/Hazel/Tcp/TcpConnection.cs +++ b/Hazel/Tcp/TcpConnection.cs @@ -157,7 +157,7 @@ namespace Hazel.Tcp } } - Statistics.LogSend(bytes.Length, fullBytes.Length); + Statistics.LogFragmentedSend(bytes.Length, fullBytes.Length); } /// @@ -197,7 +197,7 @@ namespace Hazel.Tcp HandleDisconnect(new HazelException("An exception occured while initiating a header receive operation.", e)); } - Statistics.LogReceive(bytes.Length, bytes.Length + 4); + Statistics.LogFragmentedReceive(bytes.Length, bytes.Length + 4); //Fire DataReceived event InvokeDataReceived(bytes, SendOption.FragmentedReliable); diff --git a/Hazel/Udp/UdpConnection.Reliable.cs b/Hazel/Udp/UdpConnection.Reliable.cs index 0ced334..2b58683 100644 --- a/Hazel/Udp/UdpConnection.Reliable.cs +++ b/Hazel/Udp/UdpConnection.Reliable.cs @@ -253,7 +253,7 @@ namespace Hazel.Udp //Write to connection WriteBytesToConnection(bytes); - Statistics.LogSend(data.Length, bytes.Length); + Statistics.LogReliableSend(data.Length, bytes.Length); } /// @@ -265,7 +265,7 @@ namespace Hazel.Udp if (ProcessReliableReceive(buffer)) InvokeDataReceived(SendOption.Reliable, buffer, 3); - Statistics.LogReceive(buffer.Length - 3, buffer.Length); + Statistics.LogReliableReceive(buffer.Length - 3, buffer.Length); } /// @@ -376,7 +376,7 @@ namespace Hazel.Udp } } - Statistics.LogReceive(0, bytes.Length); + Statistics.LogReliableReceive(0, bytes.Length); } /// diff --git a/Hazel/Udp/UdpConnection.cs b/Hazel/Udp/UdpConnection.cs index e65b1f5..7e7e745 100644 --- a/Hazel/Udp/UdpConnection.cs +++ b/Hazel/Udp/UdpConnection.cs @@ -98,18 +98,17 @@ namespace Hazel.Udp //We need to acknowledge hello messages but dont want to invoke any events! case (byte)SendOptionInternal.Hello: ProcessReliableReceive(buffer); - Statistics.LogReceive(buffer.Length - 3, buffer.Length); + Statistics.LogHelloReceive(buffer.Length); break; case (byte)SendOptionInternal.Disconnect: - HandleDisconnect(); - Statistics.LogReceive(0, buffer.Length); + HandleDisconnect(); break; //Treat everything else as unreliable default: InvokeDataReceived(SendOption.None, buffer, 1); - Statistics.LogReceive(buffer.Length - 1, buffer.Length); + Statistics.LogUnreliableReceive(buffer.Length - 1, buffer.Length); break; } } @@ -127,7 +126,7 @@ namespace Hazel.Udp //Write to connection WriteBytesToConnection(bytes); - Statistics.LogSend(data.Length, bytes.Length); + Statistics.LogUnreliableSend(data.Length, bytes.Length); } ///