mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Fixed issue where mac connections would not time out as expected (#81)
* Fixed issue where mac connections would not time out as expected * Made check specific to OSX * Added check for linux
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.SqlClient;
|
using System.Data.SqlClient;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
||||||
@@ -215,6 +216,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
|
|
||||||
public static bool IsRetryableNetworkConnectivityError(int errorNumber)
|
public static bool IsRetryableNetworkConnectivityError(int errorNumber)
|
||||||
{
|
{
|
||||||
|
// .NET core has a bug on OSX/Linux that makes this error number always zero (issue 12472)
|
||||||
|
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
{
|
||||||
|
return errorNumber != 0 && _retryableNetworkConnectivityErrors.Contains(errorNumber);
|
||||||
|
}
|
||||||
return _retryableNetworkConnectivityErrors.Contains(errorNumber);
|
return _retryableNetworkConnectivityErrors.Contains(errorNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user