From 40e8d0c75e5f19167f08f0159830723684178a4f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 20 Dec 2016 00:21:52 -0500 Subject: [PATCH] add additional http server error handling --- Nuget/MediaBrowser.Common.nuspec | 2 +- Nuget/MediaBrowser.Server.Core.nuspec | 4 ++-- RSSDP/SsdpCommunicationsServer.cs | 4 ++++ SocketHttpListener.Portable/Net/EndPointListener.cs | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index daeb754bac..6b58957204 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.691 + 3.0.692 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index a34a9bee20..36ff962261 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.691 + 3.0.692 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index b709861d5f..97f5ebbd06 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -182,6 +182,10 @@ namespace Rssdp.Infrastructure try { await socket.SendAsync(messageData, messageData.Length, destination).ConfigureAwait(false); + } + catch (ObjectDisposedException) + { + } catch (Exception ex) { diff --git a/SocketHttpListener.Portable/Net/EndPointListener.cs b/SocketHttpListener.Portable/Net/EndPointListener.cs index 690dedd092..2bd7a3da6f 100644 --- a/SocketHttpListener.Portable/Net/EndPointListener.cs +++ b/SocketHttpListener.Portable/Net/EndPointListener.cs @@ -71,7 +71,10 @@ namespace SocketHttpListener.Net } catch (SocketCreateException ex) { - if (_enableDualMode && endpoint.IpAddress.Equals(IpAddressInfo.IPv6Any) && string.Equals(ex.ErrorCode, "AddressFamilyNotSupported", StringComparison.OrdinalIgnoreCase)) + if (_enableDualMode && endpoint.IpAddress.Equals(IpAddressInfo.IPv6Any) && + (string.Equals(ex.ErrorCode, "AddressFamilyNotSupported", StringComparison.OrdinalIgnoreCase) || + // mono on bsd is throwing this + string.Equals(ex.ErrorCode, "ProtocolNotSupported", StringComparison.OrdinalIgnoreCase))) { endpoint = new IpEndPointInfo(IpAddressInfo.Any, endpoint.Port); _enableDualMode = false;