Question about getaddrinfo in Inet4AddressImpl.c
littlee at linux.vnet.ibm.com
Tue Oct 25 00:31:44 PDT 2011
I am reading some native code in the jdk repos. I find that in
Inet4AddressImpl.c (folder solaris), gethostbyname is used. Meanwhile in
the Inet6AddressImpl.c. getaddrinfo is used. My question is why inet4
does not use getaddrinfo? Any concern here?
There are some pros I can see if getaddrinfo is used in the
1. Code will look more clean and portable :-)
2. __GLIBC__ can be omitted. I have grep the __GLIBC__ in the jdk/src
directories, only Inet4AddressImpl use it.
More information about the net-dev