The Free Software Media System - Server Backend & API
Prevent failure to bind to Auto Discover port being a fatal error
Neil Burrows359b0044b848
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.csindex b207397bda..a9e84c2384 100644--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs@@ -48,8 +48,16 @@ namespace Emby.Server.Implementations.EntryPoints/// <inheritdoc />public Task RunAsync(){- _udpServer = new UdpServer(_logger, _appHost, _config);- _udpServer.Start(PortNumber, _cancellationTokenSource.Token);+ try+ {+ _udpServer = new UdpServer(_logger, _appHost, _config);+ _udpServer.Start(PortNumber, _cancellationTokenSource.Token);+ }+ catch (System.Net.Sockets.SocketException ex)+ {+ _logger.LogWarning($"Unable to start AutoDiscovery listener on UDP port {PortNumber} - {ex.Message}");+ }+return Task.CompletedTask;}