从字面上看java.net.Inet6Address.getByName是否会出去并查看地址是否存在 [英] Does java.net.Inet6Address.getByName Literally Go Out and See if the Address Exists

查看:84
本文介绍了从字面上看java.net.Inet6Address.getByName是否会出去并查看地址是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道Java,但您可以从此问题中看到( 如果提供了原义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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆