软件包 | 描述 |
---|---|
java.net |
为实现网络应用程序提供类。
|
javax.net |
为网络应用程序提供类。
|
javax.net.ssl |
为安全套接字包提供类。
|
Modifier and Type | Method and Description |
---|---|
static InetAddress[] |
InetAddress.getAllByName(String host)
给定一个主机的名称,返回其IP地址的数组,基于系统上的配置的名称服务。
|
static InetAddress |
InetAddress.getByAddress(byte[] addr)
返回给定的原始IP地址
InetAddress 对象。
|
static InetAddress |
InetAddress.getByAddress(String host, byte[] addr)
它创造了一个基于所提供的主机名和IP地址。
|
static Inet6Address |
Inet6Address.getByAddress(String host, byte[] addr, int scope_id)
创建一个在
InetAddress.getByAddress(String,byte[]) Inet6Address确切的方式除了IPv6 scope_id设置为给定的值。
|
static Inet6Address |
Inet6Address.getByAddress(String host, byte[] addr, NetworkInterface nif)
创建一个在
InetAddress.getByAddress(String,byte[]) Inet6Address确切的方式除了IPv6 scope_id设置,给出了相应的规定
addr 地址类型接口的价值。
|
static InetAddress |
InetAddress.getByName(String host)
确定主机的IP地址,给定主机名。
|
static InetAddress |
InetAddress.getLocalHost()
返回本地主机的地址。
|
Constructor and Description |
---|
Socket(String host, int port)
创建一个流套接字,并将其与指定的主机上的指定端口号连接起来。
|
Modifier and Type | Method and Description |
---|---|
abstract Socket |
SocketFactory.createSocket(String host, int port)
创建一个套接字,并将其连接到指定的远程端口上的指定的远程主机上。
|
abstract Socket |
SocketFactory.createSocket(String host, int port, InetAddress localHost, int localPort)
创建一个套接字,并将其连接到指定的远程端口上的指定的远程主机上。
|
Constructor and Description |
---|
SSLSocket(String host, int port)
仅由子类使用。
|
SSLSocket(String host, int port, InetAddress clientAddress, int clientPort)
仅由子类使用。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.