aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/SsdpCommunicationsServer.cs
diff options
context:
space:
mode:
authorAndrew Rabert <6550543+nvllsvm@users.noreply.github.com>2019-01-13 19:02:40 +0000
committerGitHub <noreply@github.com>2019-01-13 19:02:40 +0000
commite8d93b3485fb509c642ab2cafdb2bce9dafdedd3 (patch)
tree0492f698b5de8c1b2885ccb8ecd5b170f001d3aa /RSSDP/SsdpCommunicationsServer.cs
parent9dcaafe700b7130b49bafbadf0d47b37c6ecf53b (diff)
parent81475e361b1665f895027feec9b4c0a4553f22dc (diff)
Merge pull request #566 from Bond-009/dlna
Avoid printing stacktrace when bind to port 1900 fails
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
-rw-r--r--RSSDP/SsdpCommunicationsServer.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs
index 5fc524428..603ba51ef 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;
@@ -126,6 +126,10 @@ namespace Rssdp.Infrastructure
{
_BroadcastListenSocket = ListenForBroadcastsAsync();
}
+ catch (SocketException ex)
+ {
+ _logger.LogError("Failed to bind to port 1900: {Message}. DLNA will be unavailable", ex.Message);
+ }
catch (Exception ex)
{
_logger.LogError(ex, "Error in BeginListeningForBroadcasts");
@@ -145,7 +149,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;
}