从字面上看java.net.Inet6Address.getByName是否会出去并查看地址是否存在 [英] Does java.net.Inet6Address.getByName Literally Go Out and See if the Address Exists
问题描述
我不知道Java,但您可以从此问题中看到( http://docs.oracle.com/javase/1.5.0/docs/api/java/net/InetAddress.html#getByName(java.lang.String))
"如果提供了原义IP地址,则仅检查地址格式的有效性."
我正在接受它,因为它无法ping通,我是否正确理解了?
这是正确的理解-它不会不发出(通过Oracle Regular Expression (REGEXP_LIKE) Too Long Error - ORA-12733) java seems to be the easiest to accomplish validating if an IPv6 address is formatted correctly. I tried regular expressions, came close, but was a nightmare, and the expression is too long for PL/SQL.
I have the java in Oracle way working. I only want to validate the format, not that the address really exists. So does java.net.Inet6Address.getByName
literally go out and see if the address exists?
The documentation says... (http://docs.oracle.com/javase/1.5.0/docs/api/java/net/InetAddress.html#getByName(java.lang.String))
"If a literal IP address is supplied, only the validity of the address format is checked."
I'm taking that as it does NOT ping, am I understanding that correctly?
That is a correct understanding - it does not issue an ICMP PING.
However, it must "Go Out" to resolve the host-name (via DNS).
Of course, when an IP literal supplied, then there is no need to resolve as such .. Use this method only if attempting a name resolve is OK/desired. Be wary when using it to generally check for the validity of an IP literal.
这篇关于从字面上看java.net.Inet6Address.getByName是否会出去并查看地址是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!