Commit b60c5568 authored by Nick Craver's avatar Nick Craver

Merge pull request #338 from MichaCo/FixPlaformSpecifics

Using RuntimeInformation.IsOSPlatform for core clr builds
parents e66eb10a 3184a798
......@@ -68,6 +68,7 @@
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
......@@ -103,6 +104,7 @@
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
......
......@@ -4,6 +4,7 @@
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
......@@ -265,11 +266,12 @@ internal void SetFastLoopbackOption(Socket socket)
#else
try
{
byte[] optionInValue = BitConverter.GetBytes(1);
socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null);
}
catch (PlatformNotSupportedException)
{
// Ioctl is not supported on other platforms at the moment
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
byte[] optionInValue = BitConverter.GetBytes(1);
socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null);
}
}
catch (SocketException)
{
......
......@@ -13,7 +13,7 @@
"dependencies": {
},
"compilationOptions": {
"allowUnsafe": true
"allowUnsafe": true
},
"frameworks": {
"net40": {
......@@ -57,6 +57,7 @@
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
......@@ -92,6 +93,7 @@
"System.Reflection.Emit.Lightweight": "4.0.1-beta-23516",
"System.Reflection.Primitives": "4.0.1-beta-23516",
"System.Reflection.TypeExtensions": "4.1.0-beta-23516",
"System.Runtime.InteropServices.RuntimeInformation": "4.0.0-beta-23516",
"System.Security.Cryptography.Algorithms": "4.0.0-beta-23516",
"System.Security.Cryptography.X509Certificates": "4.0.0-beta-23516",
"System.Text.Encoding": "4.0.11-beta-23516",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment