|
|
@@ -1,8 +1,8 @@
|
|
|
// Copyright (c) .NET Foundation. All rights reserved.
|
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
|
|
+using System;
|
|
|
using System.Runtime.CompilerServices;
|
|
|
-using System.Runtime.InteropServices;
|
|
|
|
|
|
namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
{
|
|
|
@@ -25,15 +25,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetECONNRESET()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4077;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -104;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -54;
|
|
|
}
|
|
|
@@ -42,15 +42,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetEPIPE()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4047;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -32;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -32;
|
|
|
}
|
|
|
@@ -59,15 +59,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetENOTCONN()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4053;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -107;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -57;
|
|
|
}
|
|
|
@@ -76,15 +76,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetEINVAL()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4071;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -22;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -22;
|
|
|
}
|
|
|
@@ -93,15 +93,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetEADDRINUSE()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4091;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -98;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -48;
|
|
|
}
|
|
|
@@ -110,11 +110,11 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetENOTSUP()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -95;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -45;
|
|
|
}
|
|
|
@@ -123,15 +123,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv.Internal
|
|
|
|
|
|
private static int? GetECANCELED()
|
|
|
{
|
|
|
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
|
|
+ if (OperatingSystem.IsWindows())
|
|
|
{
|
|
|
return -4081;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
|
|
+ else if (OperatingSystem.IsLinux())
|
|
|
{
|
|
|
return -125;
|
|
|
}
|
|
|
- else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
|
|
+ else if (OperatingSystem.IsMacOS())
|
|
|
{
|
|
|
return -89;
|
|
|
}
|