Latest News
Today Apple launched heavy news, June 1 after all applications must support IPV6-ONLY Network!!! When the iOS developer sees this message the first reaction may be that IPV6 is a ghost!! In fact, IPV6 has been launched early in the morning, and Apple at the 2015 developer's Conference has suggested that Apple will be very IPv6 website link
Ipv6-only
Say so much, IPv6 what the hell is a ghost! Let's take a look at how Baidu Encyclopedia explains:
Let's take a look at the official comparison of IPV6 and IPV4:
Do not understand?? , let's explain the following:
1, IPV6: Avoid network address translation (NAT)
2, through the network through the use of simplified headers to provide faster routing
3. Prevent Network segmentation
4. Avoid address resolution for broadcast neighbors
Having said so much, let's take a look at how to implement IPV6 in iOS development
Using IPV6 in development does not recommend using the underlying network API
There are no compatibility issues with these APIs in the blue part of the show, and most of the APIs we use for ourselves include those of third-party web libraries.
In most cases, we use the Advanced API to fully realize our needs, and the Advanced API package is very easy to use, and many of the bottom-level IPv6-like work has been done for us. And with the underlying API there will be a lot of work for us to do, more prone to bug. But if you do need to use the underlying POSIX socket API, refer to this rfc4038:application aspects of IPV6 transition guidance.
PS: The system comes with the network class has supported IPV6 we just need to rest assured that the use of good, such as nsurlsession, etc.;
Do not use IP addresses directly
For example, the following api,nodename this parameter does not pass the IP address, but should use the domain name
This method is used in the famous third-party reachability , which is used by our third-party network library afnetworking . So the students used to have a good look.
Check for incompatible IPV6 code
Search the project there are not the following API, these are only for IPv4 processing, and some words are deleted.
inet_ Addr () inet_aton () inet_lnaof () inet_makeaddr () inet_netof () inet_network () inet_ntoa () Inet_ntoa_r () bindresvport () getipv4sourcefilter () Span class= "Hljs-title" >setipv4sourcefilter ()
If you use these IPv4 types on the left, then their corresponding IPV6 types also need to be handled
Local Build IPV6 test environment
Finally, let's set up a IPV6 test environment, all you need is a non-wi-Fi way to surf the Internet Mac computer.
What we have to do is to use a Mac to do a hot spot, and then use the iphone to connect to this Wi-Fi, it sounds easy, I believe everyone in the company is doing so.
The difference is that this time we are producing a local IPv6 dns64/nat64 Network, which is a new addition to OS X 10.11 . Unlike the way we used to open hotspots, we have to press and hold the Option key while " sharing" is selected in the "System Preferences" interface.
Then in the "sharing" interface, we will see and before the same place, is the red box labeled place, a more called "Create NAT64 Network" box, select it.
After that, just follow the normal process of creating hotspots.
Now we can use the iphone to connect to this newly created hot spot to be able to test, note that this time to set the iphone into flight mode, to ensure that only Wi-Fi internet access.
Refer to the official original link: https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/ networkingoverview/understandingandpreparingfortheipv6transition/ Understandingandpreparingfortheipv6transition.html#//apple_ref/doc/uid/tp40010220-ch213-sw1
The latest audit requirements for Apple iOS are compatible with the app IPv6