From: JamJar00 Date: Sat, 31 Dec 2016 16:44:23 +0000 (+0000) Subject: Fixed all warnings X-Git-Tag: 1.0.0~115 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=7f21d425c65bc8d131030884bf94db4422d762e1;p=rhonda%2Fimpostor.hazel.git Fixed all warnings --- diff --git a/Hazel.UnitTests/TcpConnectionTests.cs b/Hazel.UnitTests/TcpConnectionTests.cs index 95b48d5..9ef0772 100644 --- a/Hazel.UnitTests/TcpConnectionTests.cs +++ b/Hazel.UnitTests/TcpConnectionTests.cs @@ -19,7 +19,7 @@ namespace Hazel.UnitTests { NetworkEndPoint ep = new NetworkEndPoint(IPAddress.Loopback, 4296); - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296))) using (TcpConnection connection = new TcpConnection(ep)) { listener.Start(); @@ -39,7 +39,7 @@ namespace Hazel.UnitTests [TestMethod] public void TcpHandshakeTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296, IPMode.IPv4)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296, IPMode.IPv4))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296, IPMode.IPv4))) { listener.Start(); @@ -59,7 +59,7 @@ namespace Hazel.UnitTests [TestMethod] public void TcpIPv4ConnectionTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296, IPMode.IPv4)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296, IPMode.IPv4))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296, IPMode.IPv4))) { listener.Start(); @@ -74,7 +74,7 @@ namespace Hazel.UnitTests [TestMethod] public void TcpIPv6ConnectionTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.IPv6Any, 4296, IPMode.IPv6)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.IPv6Any, 4296, IPMode.IPv6))) { listener.Start(); @@ -91,7 +91,7 @@ namespace Hazel.UnitTests [TestMethod] public void TcpServerToClientTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296))) { TestHelper.RunServerToClientTest(listener, connection, 10, SendOption.FragmentedReliable); @@ -104,7 +104,7 @@ namespace Hazel.UnitTests [TestMethod] public void TcpClientToServerTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296))) { TestHelper.RunClientToServerTest(listener, connection, 10, SendOption.FragmentedReliable); @@ -117,7 +117,7 @@ namespace Hazel.UnitTests [TestMethod] public void ClientDisconnectTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296))) { TestHelper.RunClientDisconnectTest(listener, connection); @@ -130,7 +130,7 @@ namespace Hazel.UnitTests [TestMethod] public void ServerDisconnectTest() { - using (TcpConnectionListener listener = new TcpConnectionListener(IPAddress.Any, 4296)) + using (TcpConnectionListener listener = new TcpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296))) using (TcpConnection connection = new TcpConnection(new NetworkEndPoint(IPAddress.Loopback, 4296))) { TestHelper.RunServerDisconnectTest(listener, connection); diff --git a/Hazel.UnitTests/UdpConnectionTests.cs b/Hazel.UnitTests/UdpConnectionTests.cs index 878fa5c..7216fb4 100644 --- a/Hazel.UnitTests/UdpConnectionTests.cs +++ b/Hazel.UnitTests/UdpConnectionTests.cs @@ -39,7 +39,7 @@ namespace Hazel.UnitTests [TestMethod] public void UdpHandshakeTest() { - using (UdpConnectionListener listener = new UdpConnectionListener(IPAddress.Any, 4296, IPMode.IPv4)) + using (UdpConnectionListener listener = new UdpConnectionListener(new NetworkEndPoint(IPAddress.Any, 4296, IPMode.IPv4))) using (UdpConnection connection = new UdpClientConnection(new NetworkEndPoint(IPAddress.Loopback, 4296, IPMode.IPv4))) { listener.Start(); diff --git a/Hazel/Udp/UdpConnection.Fragmented.cs b/Hazel/Udp/UdpConnection.Fragmented.cs index 09248bd..f8acb32 100644 --- a/Hazel/Udp/UdpConnection.Fragmented.cs +++ b/Hazel/Udp/UdpConnection.Fragmented.cs @@ -27,7 +27,7 @@ namespace Hazel.Udp void FragmentedSend(byte[] data) { //Get an ID not used yet. - ushort id = ++lastFragmentIDAllocated; //TODO manage loop around + ushort id = ++lastFragmentIDAllocated; //TODO is extra code needed to manage loop around? for (ushort i = 0; i < Math.Ceiling(data.Length / (double)FragmentSize); i++) { diff --git a/Hazel/Udp/UdpConnectionListener.cs b/Hazel/Udp/UdpConnectionListener.cs index 5c3c44c..6ad04e7 100644 --- a/Hazel/Udp/UdpConnectionListener.cs +++ b/Hazel/Udp/UdpConnectionListener.cs @@ -117,7 +117,7 @@ namespace Hazel.Udp //If the socket's been disposed then we can just end there. return; } - catch (SocketException e) + catch (SocketException) { //Client no longer reachable, pretend it didn't happen //TODO should this not inform the connection this client is lost???