More robust server initiated client socket shutdown
@@ -118,7 +118,10 @@ namespace MiningCore.JsonRpc
upstream.Shutdown((tcp, ex) =>
{
- upstream.Dispose();
+ upstream.CloseHandle(handle =>
+ {
+ handle.Dispose();
+ });
});
}
});
@@ -140,7 +143,6 @@ namespace MiningCore.JsonRpc
try
{
- if(!upstream.IsClosing)
upstream.QueueWrite(Encoding.UTF8.GetBytes(json));
}
catch (ObjectDisposedException)
@@ -156,7 +158,6 @@ namespace MiningCore.JsonRpc
try
{
- if (!upstream.IsClosing)
upstream.QueueWrite(Encoding.UTF8.GetBytes(json));
}
catch (ObjectDisposedException)
