2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00

AsyncQueue Fix

This commit is contained in:
2020-02-08 11:57:00 +03:00
parent 741819e11c
commit 3205499747
5 changed files with 20 additions and 14 deletions

View File

@ -389,15 +389,24 @@ namespace Esyur.Net.Sockets
}
catch (Exception ex)
{
kv.Key.Trigger(false);
asyncSending = false;
if (state != SocketState.Closed && !sock.Connected)
try
{
state = SocketState.Terminated;
Close();
kv.Key.Trigger(false);
if (state != SocketState.Closed && !sock.Connected)
{
state = SocketState.Terminated;
Close();
}
}
catch (Exception ex2)
{
Console.WriteLine("Level 2 {0}", ex2);
}
asyncSending = false;
Global.Log("TCPSocket", LogType.Error, ex.ToString());
}