aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorNeil Burrows <neil.burrows@nvable.com>2020-07-13 15:12:51 +0100
committerNeil Burrows <neil.burrows@nvable.com>2020-07-13 15:12:51 +0100
commit359b0044b848cf49e8c52bb30fb1a3e8cf8f16b7 (patch)
treee395a70b7133c8dc8b676ab4fd23e1b22e0d4623 /Emby.Server.Implementations
parent52290380aa5e3cafc5208a9e4b5ebf1b93f52d38 (diff)
Prevent failure to bind to Auto Discover port being a fatal error
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index b207397bd..a9e84c238 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;
}