Hello, I am trying to connect to a raw socket IPv6 host with no success. Please help. Whenever I try this I get the same exception. I am using Unity 4.2.0, .NET 4.5.1, Win 7 and the system has both IPv4 and IPv6 TCP stacks enabled, as shown in this output: Code (csharp): F:\Users\Ozelo\Downloads\AsyncResolveNameChap6CS\AsyncResolveNameChap6CS\AsyncRe solveNameChap6CS\bin\Debug>AsyncResolveNameChap6CS.exe google.com BeginGetHostEntry() is OK... Press any key to stop this program... The primary host name is: google.com No Aliases found... IP addresses found are: IPv6 Address #1 is 2800:3f0:4001:817::1005 IPv4 Address #1 is 173.194.118.232 IPv4 Address #2 is 173.194.118.224 IPv4 Address #3 is 173.194.118.233 IPv4 Address #4 is 173.194.118.226 IPv4 Address #5 is 173.194.118.225 IPv4 Address #6 is 173.194.118.238 IPv4 Address #7 is 173.194.118.229 IPv4 Address #8 is 173.194.118.227 IPv4 Address #9 is 173.194.118.228 IPv4 Address #10 is 173.194.118.230 IPv4 Address #11 is 173.194.118.231 Finished querying DNS. Read() is OK... The program used to check if GetHostEntry works can be found here. For some reason I don't know, Socket.SupportsIPv6 return FALSE but Socket.OSSupportsIPv6 return TRUE. This is the code I did on Unity that is NOT giving me any IPv6 address: Code (csharp): #pragma strict import System.Net; import System.Net.Sockets; private var ipv6addr="unavailable?"; private var ipv4addr="unavailable?"; private var ssipv6="TRUE"; private var osipv6="TRUE"; function Start() { if (!Socket.SupportsIPv6) ssipv6 = "FALSE"; if (!Socket.OSSupportsIPv6) osipv6 = "FALSE"; var RemoteHost: IPHostEntry = Dns.GetHostEntry("google.com"); for (var ASimpleIPAddr: IPAddress in RemoteHost.AddressList) { if (ASimpleIPAddr.AddressFamily != AddressFamily.InterNetwork) ipv6addr = ASimpleIPAddr.ToString(); else ipv4addr = ASimpleIPAddr.ToString(); } } function OnGUI() { var mX = (Screen.width / 2); var mY = (Screen.height / 2); var box_width = mX; var box_height = mY; var box_lx = mX - (box_width / 2); var box_ly = mY - (box_height / 2); GUI.Box(Rect(box_lx, box_ly, box_width, box_height), "DUAL STACK INFO"); GUI.Label(Rect(box_lx + 6, box_ly + 30, box_width, 20), "IPv6 Address: " + ipv6addr); GUI.Label(Rect(box_lx + 6, box_ly + 45, box_width, 20), "IPv4 Address: " + ipv4addr); GUI.Label(Rect(box_lx + 6, box_ly + 60, box_width, 20), "Socket.OSSupportsIPv6? " + osipv6); GUI.Label(Rect(box_lx + 6, box_ly + 75, box_width, 20), "Socket.SupportsIPv6? " + ssipv6); }
I just found that the Unity3D code above works perfectly on Linux Ubuntu 12.04 and I don´t know why it won't work on my Windows 7 station... I am clueless.
I am clueless, definitely. The same code. I couldn't figure why it works on Linux but does NOT work on Windows. Both machines have IPv6 enabled. Please, could any of you test it and give me some feed-back if it works on your system? It should state how are your dual stack and give back the google.com IPv4 and IPv6 addresses. Here are the files: IPCheck.rar (Windows version) LIPCheck.rar (Linux version)
We have this same problem on 5.3.5 - it came down to using ".Net 2.0" compatibility in the player build settings rather than ".Net 2.0 Subset". I'm not sure *why* it works, as technically .Net 2.0 should have everything that the subset has and more, but try switching them. This is the bug report if you're interested: https://fogbugz.unity3d.com/default.asp?804510_c5ei44diq6ktnh1u Also, in this thread (http://forum.unity3d.com/threads/unity-ios-and-ipv6-support.404938/#post-2676696) they specifically said they didn't backport some IPv6 fixes to the Unity4 windows branch, so it might just be that as well.