黑马程序员 java 网络编程
Security类
Thisclass centralizes all security properties and common securitymethods. One of its primary uses is to manage providers.
networkaddress.cache.ttl属性
在jdk的/usr/lib/jvm/jdk7/jre/lib/security/java.security文件中
参数args[1]:表示缓存时间,-1表示永久缓存。
public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketExceptionpublic static NetworkInterface getByName(String name) throws SocketException
在java中,已经将域名解析功能包含在Socket类中,所以我们可以想使用ip一样使用域名。