Commit 7cc58d30 authored by Marc Gravell's avatar Marc Gravell

Merge pull request #327 from jeremymeng/socket_ioctl

Fix an issue where SetFastLoopbackOption() throws PlatformNotSupportedException on non-Windows platforms.
parents fc00955b b86efd1d
...@@ -251,13 +251,19 @@ internal void SetFastLoopbackOption(Socket socket) ...@@ -251,13 +251,19 @@ internal void SetFastLoopbackOption(Socket socket)
var osVersion = Environment.OSVersion.Version; var osVersion = Environment.OSVersion.Version;
if (osVersion.Major > 6 || osVersion.Major == 6 && osVersion.Minor >= 2) if (osVersion.Major > 6 || osVersion.Major == 6 && osVersion.Minor >= 2)
{ {
#endif
byte[] optionInValue = BitConverter.GetBytes(1); byte[] optionInValue = BitConverter.GetBytes(1);
socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null); socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null);
#if !CORE_CLR
} }
} }
#else
try
{
byte[] optionInValue = BitConverter.GetBytes(1);
socket.IOControl(SIO_LOOPBACK_FAST_PATH, optionInValue, null);
}
catch (PlatformNotSupportedException)
{
}
#endif #endif
} }
......
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