diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-01-12 22:25:55 +0100 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2019-01-15 19:14:36 -0500 |
| commit | 5348fddc9eb9584cbec4449273c0c356becfe354 (patch) | |
| tree | b3ee40b25cd039536da704915f6c07bd84e5cc5c | |
| parent | 30fef791209e04a79cf988046194aab6956f9a1b (diff) | |
Don't print stacktrace when failing to bind to 1900
| -rw-r--r-- | RSSDP/SsdpCommunicationsServer.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index 65ec0ca71..fb13298ee 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Net; using System.Net.Http; +using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -129,6 +129,10 @@ namespace Rssdp.Infrastructure { _BroadcastListenSocket = ListenForBroadcastsAsync(); } + catch (SocketException) + { + _logger.LogError("Failed to bind to port 1900. DLNA will be unavailable"); + } catch (Exception ex) { _logger.LogError(ex, "Error in BeginListeningForBroadcasts"); @@ -148,7 +152,7 @@ namespace Rssdp.Infrastructure { if (_BroadcastListenSocket != null) { - _logger.LogInformation("{0} disposing _BroadcastListenSocket.", GetType().Name); + _logger.LogInformation("{0} disposing _BroadcastListenSocket", GetType().Name); _BroadcastListenSocket.Dispose(); _BroadcastListenSocket = null; } |
