]> git.deb.at Git - rhonda/impostor.hazel.git/commitdiff
Fixed all warnings
authorJamJar00 <jamster.30@btinternet.com>
Sat, 31 Dec 2016 16:44:23 +0000 (16:44 +0000)
committerJamJar00 <jamster.30@btinternet.com>
Sat, 31 Dec 2016 16:44:23 +0000 (16:44 +0000)
Hazel.UnitTests/TcpConnectionTests.cs
Hazel.UnitTests/UdpConnectionTests.cs
Hazel/Udp/UdpConnection.Fragmented.cs
Hazel/Udp/UdpConnectionListener.cs

index 95b48d5b22935dae9b1f97f635e2b5dde4f5a66f..9ef0772f7f1cd4a7fc68f4ef285ee894c0ec7826 100644 (file)
@@ -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);
index 878fa5c60adbdfbb47dbc1ec8d9ac295450793f7..7216fb4cc20d6b9bce5f5d92078321086bfa2b05 100644 (file)
@@ -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();
index 09248bdd3bde0c59e75cb49189dab038e52c7f5d..f8acb322d2afa2f46c1450241993342ddc4791fb 100644 (file)
@@ -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++)
             {
index 5c3c44ce203718069192de2aaf5d2b34be07957f..6ad04e75c52b887c11c6e8af441ce3141fee93a9 100644 (file)
@@ -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???