Commit b86efd1d authored by Jeremy Meng's avatar Jeremy Meng

Fix an issue where SetFastLoopbackOption() throws...

Fix an issue where SetFastLoopbackOption() throws PlatformNotSupportedException on non-Windows platrorms.
parent 5e94e688
......@@ -251,13 +251,19 @@ internal void SetFastLoopbackOption(Socket socket)
var osVersion = Environment.OSVersion.Version;
if (osVersion.Major > 6 || osVersion.Major == 6 && osVersion.Minor >= 2)
{
#endif
byte[] optionInValue = BitConverter.GetBytes(1);
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
}
......
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