Unity IPv6 A few things to note:
1.unity version: 5.3.4 P4
2. The server IP address needs to be converted via iOS native code getaddrinfo
3.socket. Localendpoint socket. Remoteendpoint (IPV6 environment Access These two variables will report the exception, need to do special processing)
4. The second parameter must be passed "HTTP" or the network will be connected to an exception
1 |
Error = getaddrinfo (ipv4_str, "http", & amp; hints, & amp; res0); |
5.ios9.2 and later versions only support IPV6 ( This must be noted ) how Apple audits support ipv6-only.
First 1th: This is said to support Ipv6-only network, in fact, let the application in the IPV6 Dns64/nat64 network environment can still run normally. But considering that our actual network environment is still a IPV4 network, the application needs to be able to ensure availability in both IPV4 and IPV6 environments. From this point, Apple does not scan IPV4 's proprietary API to deny auditing because the IPV4 API and IPV6 API calls both exist in the code.
Second 2nd: Apple's official statement iOS9 began to support the transition to IPV6, where ios9.2+ supported IPV4 address synthesis IPV6 addresses. The reachability library provided in the IOS8 system, when switching from IPV4 to IPV6 network, or from IPV6 network to IPV4, is unable to monitor the network status changes. Some developers also ask Apple's audit department for these bugs, and the answer is that they only need to ensure IPV6 compatibility on Apple's newest system .
finally 3rd: as long as the application of mainstream support IPV6, through the Apple audit can. For modules that do not support IPV6, it takes a while for our IPV6 network to be deployed and will not affect the use of our users for a short period of time. But with the deployment of the 4G network IPV6, this part of the module still needs to be gradually arranged to support the manpower.
IOS IPV6 Official Note document: https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/ networkingoverview/understandingandpreparingfortheipv6transition/ Understandingandpreparingfortheipv6transition.html#//apple_ref/doc/uid/tp40010220-ch213-sw1
The source code for everyone to paste it out (a bit of confusion, please forgive us):
iOS code. h file
1 2 3) 4 5 |
@ interface Bundleid:nsobject + (NSString *) GETIPV6: (const char *) Mhost: (const char *) mport; @ end |
iOS code. m file