mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-25 23:18:54 +02:00
Merge pull request #3549 from neilsb/master
Prevent failure to bind to Auto Discover port being a fatal error
This commit is contained in:
commit
2307052efc
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Emby.Server.Implementations.Udp;
|
using Emby.Server.Implementations.Udp;
|
||||||
|
@ -48,8 +49,16 @@ namespace Emby.Server.Implementations.EntryPoints
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public Task RunAsync()
|
public Task RunAsync()
|
||||||
{
|
{
|
||||||
_udpServer = new UdpServer(_logger, _appHost, _config);
|
try
|
||||||
_udpServer.Start(PortNumber, _cancellationTokenSource.Token);
|
{
|
||||||
|
_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;
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue