inet_aton和inet_pton的区别

RTM: inet_aton() doesn't appear to support IPv6, inet_pton does. The parameter lists are different. The return values are different. inet_pton() requires a four part dot notation and inet_aton can process some other presentation formats.



Don't be surprised that you will encounter similar and sometimes identical functions by different names. The internet protocol has been evolving since the 60's and has only been "standardized" in the later half of it's history. Some differences in socket API's still exist from one OS to another. They are slowly converging via the standards processes, but the old API's continue to be supported.



I believe inet_aton() is, or will soon be deprecated. But your going to see it in a lot of code for at least another decade

你可能感兴趣的:(net)