Replace ISocket and UdpSocket, fix DLNA and SSDP binding and discovery

This commit is contained in:
Shadowghost
2023-02-16 18:15:12 +01:00
parent 3a91c37283
commit 42498194d9
21 changed files with 289 additions and 557 deletions

View File

@@ -1025,7 +1025,7 @@ namespace Emby.Server.Implementations
return PublishedServerUrl.Trim('/');
}
string smart = NetManager.GetBindInterface(hostname, out var port);
string smart = NetManager.GetBindAddress(hostname, out var port);
return GetLocalApiUrl(smart.Trim('/'), null, port);
}
@@ -1033,7 +1033,7 @@ namespace Emby.Server.Implementations
public string GetApiUrlForLocalAccess(IPAddress ipAddress = null, bool allowHttps = true)
{
// With an empty source, the port will be null
var smart = NetManager.GetBindAddress(ipAddress, out _);
var smart = NetManager.GetBindAddress(ipAddress, out _, true);
var scheme = !allowHttps ? Uri.UriSchemeHttp : null;
int? port = !allowHttps ? HttpPort : null;
return GetLocalApiUrl(smart, scheme, port);