diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-13 18:38:26 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-13 18:38:26 -0500 |
| commit | 524e7facc87e746745af9095a3f100dcec1799b6 (patch) | |
| tree | 3711beec7e1e9aa937e86883e38505beddded382 /Emby.Common.Implementations/Net/SocketFactory.cs | |
| parent | dcd06597a7cc1d4a7829ed75e0a6b1e52fd5c10e (diff) | |
fix socket errors on linux under .net core
Diffstat (limited to 'Emby.Common.Implementations/Net/SocketFactory.cs')
| -rw-r--r-- | Emby.Common.Implementations/Net/SocketFactory.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Emby.Common.Implementations/Net/SocketFactory.cs b/Emby.Common.Implementations/Net/SocketFactory.cs index 1f41ffff5..70c7ba845 100644 --- a/Emby.Common.Implementations/Net/SocketFactory.cs +++ b/Emby.Common.Implementations/Net/SocketFactory.cs @@ -125,15 +125,15 @@ namespace Emby.Common.Implementations.Net try { -#if NETSTANDARD1_3 - // The ExclusiveAddressUse socket option is a Windows-specific option that, when set to "true," tells Windows not to allow another socket to use the same local address as this socket - // See https://github.com/dotnet/corefx/pull/11509 for more details - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) +#if NET46 + retVal.ExclusiveAddressUse = false; +#else + // The ExclusiveAddressUse socket option is a Windows-specific option that, when set to "true," tells Windows not to allow another socket to use the same local address as this socket + // See https://github.com/dotnet/corefx/pull/11509 for more details + if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) { retVal.ExclusiveAddressUse = false; } -#else - retVal.ExclusiveAddressUse = false; #endif //retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true); retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); |
