using System.Net;
using System.Threading;
using Hazel.Udp;
-using System.Linq;
-using System.Collections.Generic;
namespace Hazel.UnitTests
{
connection.Connect();
connection.Dispose();
- Thread.Sleep(10);
+ Thread.Sleep(50);
Assert.IsTrue(serverConnected);
Assert.IsTrue(serverDisconnected);
</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
+ <LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
+ <LangVersion>7.3</LangVersion>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+ <LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
/// </summary>
/// <param name="e">The exception if one was the cause.</param>
public override void Disconnect(string reason)
- {
- this.Disconnect(reason, false);
- }
-
- protected void Disconnect(string reason, bool skipSendDisconnect)
{
bool invoke = false;
lock (this)
{
if (this._state == ConnectionState.Connected)
{
- this._state = skipSendDisconnect ? ConnectionState.NotConnected : ConnectionState.Disconnecting;
+ this._state = ConnectionState.Disconnecting;
invoke = true;
}
}
using System;
using System.Collections.Concurrent;
-using System.Linq;
-using System.Text;
using System.Threading;
namespace Hazel
if (!inuse.TryAdd(item, true))
{
- throw new Exception("Duplicate pull");
+ throw new Exception("Duplicate pull " + typeof(T).Name);
}
return item;
}
else
{
- throw new Exception("Duplicate add");
+ throw new Exception("Duplicate add " + typeof(T).Name);
}
}
}
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Net;
using System.Net.Sockets;
-using System.Text;
using System.Threading;
}
catch (SocketException ex)
{
- Disconnect("Could not send data as a SocketException occured: " + ex.Message, true);
+ Disconnect("Could not send data as a SocketException occured: " + ex.Message);
}
}
}
catch (SocketException ex)
{
- Disconnect("Could not send data as a SocketException occured: " + ex.Message, true);
+ Disconnect("Could not send data as a SocketException occured: " + ex.Message);
}
}
break;
case (byte)UdpSendOption.Disconnect:
- Disconnect("The remote sent a disconnect request", true);
+ Disconnect("The remote sent a disconnect request");
message.Recycle();
break;
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Net;
-using System.Text;
-using System.Threading;
namespace Hazel.Udp
{