The Free Software Media System - Server Backend & API
ignore socket error on reuseaddress
Luke Pulverenti4f19a7a032aa
diff --git a/Emby.Common.Implementations/Net/SocketFactory.cs b/Emby.Common.Implementations/Net/SocketFactory.csindex 1fd367afb9..5169c5a219 100644--- a/Emby.Common.Implementations/Net/SocketFactory.cs+++ b/Emby.Common.Implementations/Net/SocketFactory.cs@@ -71,10 +71,18 @@ namespace Emby.Common.Implementations.Netif (remotePort < 0) throw new ArgumentException("remotePort cannot be less than zero.", "remotePort");var retVal = new Socket(AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);-+try{retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);+ }+ catch (SocketException)+ {+ // This is not supported on all operating systems (qnap)+ }++ try+ {return new UdpSocket(retVal, new IpEndPointInfo(remoteAddress, remotePort));}catch