Catch all error thrown by EndAccept

This commit is contained in:
nicolas.dorier 2020-04-09 20:36:19 +09:00
parent 70c80f4d44
commit 1c0d713b00
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -92,7 +92,7 @@ namespace BTCPayServer.HostedServices
{
clientSocket = ctx.ServerSocket.EndAccept(ar);
}
catch (ObjectDisposedException)
catch (Exception)
{
return;
}
@ -111,7 +111,14 @@ namespace BTCPayServer.HostedServices
CancellationToken = connectionCts.Token,
CancellationTokenSource = connectionCts
});
ctx.ServerSocket.BeginAccept(Accept, ctx);
try
{
ctx.ServerSocket.BeginAccept(Accept, ctx);
}
catch (Exception)
{
return;
}
}
static void ConnectToSocks(IAsyncResult ar)