From 66e901ef93942c631c3ee3b222cc75265e1b17fb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 7 Apr 2017 15:26:19 -0400 Subject: fix merge conflicts --- Emby.Common.Implementations/Net/SocketFactory.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Emby.Common.Implementations/Net/SocketFactory.cs') diff --git a/Emby.Common.Implementations/Net/SocketFactory.cs b/Emby.Common.Implementations/Net/SocketFactory.cs index 5169c5a21..39f236afa 100644 --- a/Emby.Common.Implementations/Net/SocketFactory.cs +++ b/Emby.Common.Implementations/Net/SocketFactory.cs @@ -70,7 +70,11 @@ namespace Emby.Common.Implementations.Net { 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 { @@ -80,7 +84,7 @@ namespace Emby.Common.Implementations.Net { // This is not supported on all operating systems (qnap) } - + try { return new UdpSocket(retVal, new IpEndPointInfo(remoteAddress, remotePort)); -- cgit v1.2.3