diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-07-15 08:16:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-15 08:16:21 +0900 |
| commit | 2307052efcb8ada177d0007384a4e17fcc2ac513 (patch) | |
| tree | ec92707cf26fa18e91e8b654b7dd125ab00918db | |
| parent | 175e7b45e56fb97b0f9bdddd99c195af3ecabcc6 (diff) | |
| parent | da8eb1f15b034b946e6533baffca8ffa17bcb3a7 (diff) | |
Merge pull request #3549 from neilsb/master
Prevent failure to bind to Auto Discover port being a fatal error
| -rw-r--r-- | Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs index b207397bd..9486874d5 100644 --- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs +++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs @@ -1,3 +1,4 @@ +using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; using Emby.Server.Implementations.Udp; @@ -48,8 +49,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 (SocketException ex) + { + _logger.LogWarning(ex, "Unable to start AutoDiscovery listener on UDP port {PortNumber}", PortNumber); + } + return Task.CompletedTask; } |
