- Home /
Using mono socket with IPv6 and TCP
I'm trying to use a mono System.Net.Socket to connect to a server using IPv6, but it appear that in the current version of mono, TCP is incompative with this AddressFamily. Is there a workaround? Might it be because the mono version bundled with Unity is not the latest?
Here's the simplest way to reproduce this behaviour:
TcpClient c = new TcpClient(AddressFamily.InterNetworkV6);
// SocketException: An address incompatible with the requested protocol was used.
Thanks.
I would like to ask if there are any solution to this question yet? I have the same problem, a IPv6 system but couldnt make a program in Unity to connect to it. :(
Are you sure the address you're supplying is an IPv6 address?
Its not a matter of supplying a Ipv6 address, but just that the code above won't compile on my ipv6 ready workstation and throw the same exception. As if only my unity3d install won't recognize that my OS has ipv6 available. Got it?
Also, this is another thread Ive made about it: http://forum.unity3d.com/threads/242101-IPv6-anyone
Just to let you know, the code above works perfectly on Linux Ubuntu 12.04, but not on my Windows 7 stations. I am clueless.
Answer by Nicolas1212 · Jun 15, 2016 at 06:17 AM
Try using ".Net 2.0 subset" in the api compatibility in the player settings. We had it originally as ".Net 2.0" and we were getting the "incompatible address" error. Changing it to the subset lets you use a hostname properly (as well as resolve them using Dns.GetHostEntry()
)
Your answer

Follow this Question
Related Questions
Will installing a newer mono version break Unity's mono installation ? (OSX) 2 Answers
Where is the Mono C# compiler for Unity iPhone? 1 Answer
Are there any tips for speeding up SQLite through Unity on iOS 1 Answer
When will Unity Support .NET 4 to the current Mono Level? 1 Answer
How can I fix a bug in the mono dlls used by unity ?, 0 Answers