20230627 java.net.InetSocketAddress
介绍
- java.net.InetSocketAddress
- public class InetSocketAddress extends SocketAddress
API
构造器
- InetSocketAddress(int port)
- InetSocketAddress(InetAddress addr, int port)
- InetSocketAddress(String hostname, int port)
public
- createUnresolved
- 创建未解析的 InetSocketAddress
- isUnresolved
- 如果不能解析该地址对象,则返回 true
- getPort
- getAddress
- 对应构造器入参中的 addr
- getHostName
- getHostString
- 返回主机名,如果没有主机名,返回地址的字符串形式