Skip to content

Commit

Permalink
Fixed all warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JamJar00 committed Dec 31, 2016
1 parent 382f24d commit 7f21d42
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions Hazel.UnitTests/TcpConnectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void TcpFieldTest()
{
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();
Expand All @@ -39,7 +39,7 @@ public void TcpFieldTest()
[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();
Expand All @@ -59,7 +59,7 @@ public void TcpHandshakeTest()
[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();
Expand All @@ -74,7 +74,7 @@ public void TcpIPv4ConnectionTest()
[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();

Expand All @@ -91,7 +91,7 @@ public void TcpIPv6ConnectionTest()
[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);
Expand All @@ -104,7 +104,7 @@ public void TcpServerToClientTest()
[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);
Expand All @@ -117,7 +117,7 @@ public void TcpClientToServerTest()
[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);
Expand All @@ -130,7 +130,7 @@ public void ClientDisconnectTest()
[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);
Expand Down
2 changes: 1 addition & 1 deletion Hazel.UnitTests/UdpConnectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void UdpFieldTest()
[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();
Expand Down
2 changes: 1 addition & 1 deletion Hazel/Udp/UdpConnection.Fragmented.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ partial class UdpConnection
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++)
{
Expand Down
2 changes: 1 addition & 1 deletion Hazel/Udp/UdpConnectionListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void ReadCallback(IAsyncResult result)
//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???
Expand Down

0 comments on commit 7f21d42

Please sign in to comment.