commit
5340d53010
|
@ -70,11 +70,23 @@ namespace Emby.Common.Implementations.Net
|
||||||
{
|
{
|
||||||
if (remotePort < 0) throw new ArgumentException("remotePort cannot be less than zero.", "remotePort");
|
if (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);
|
var addressFamily = remoteAddress.AddressFamily == IpAddressFamily.InterNetwork
|
||||||
|
? AddressFamily.InterNetwork
|
||||||
|
: AddressFamily.InterNetworkV6;
|
||||||
|
|
||||||
|
var retVal = new Socket(addressFamily, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
retVal.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
|
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));
|
return new UdpSocket(retVal, new IpEndPointInfo(remoteAddress, remotePort));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.8.16")]
|
[assembly: AssemblyVersion("3.2.9.2")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user