mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-18 20:24:20 +01:00
fix socket errors on linux under .net core
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace Emby.Common.Implementations.Networking
|
||||
//}
|
||||
|
||||
return ipProperties.UnicastAddresses
|
||||
.Where(i => i.IsDnsEligible)
|
||||
//.Where(i => i.IsDnsEligible)
|
||||
.Select(i => i.Address)
|
||||
.Where(i => i.AddressFamily == AddressFamily.InterNetwork)
|
||||
.ToList();
|
||||
|
||||
Reference in New Issue
Block a user