aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2020-07-23 23:50:12 +0000
committerGitHub <noreply@github.com>2020-07-23 23:50:12 +0000
commit3d69cea1c9724210c31467bde5204c2649a23992 (patch)
treea73e7b774b0f5a7e074dedbc62ba4bf555bd3222 /Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
parent5f67ba4d7087d7a0cad37fc9e2db212340076d12 (diff)
parent845ee21ddce8ed91d8c3c1463d0d7a06bb769635 (diff)
Merge branch 'master' into displaypreferences-efcore
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs')
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs13
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;
}