软件包 | 描述 |
---|---|
java.net |
为实现网络应用程序提供类。
|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
Modifier and Type | Field and Description |
---|---|
static SocketOption<NetworkInterface> |
StandardSocketOptions.IP_MULTICAST_IF
互联网协议(IP)的网络接口的多播数据报。
|
Modifier and Type | Method and Description |
---|---|
static NetworkInterface |
NetworkInterface.getByIndex(int index)
给出一个给定索引的网络接口。
|
static NetworkInterface |
NetworkInterface.getByInetAddress(InetAddress addr)
方便的方法来搜索一个网络接口,该接口有指定的因特网协议(IP)地址绑定到它。
|
static NetworkInterface |
NetworkInterface.getByName(String name)
用指定名称搜索网络接口。
|
NetworkInterface |
MulticastSocket.getNetworkInterface()
获取组播网络接口集。
|
NetworkInterface |
NetworkInterface.getParent()
如果这是一个接口返回该接口网络接口
null 母,或如果它是一个物理(非虚拟的)接口或没有父。
|
NetworkInterface |
Inet6Address.getScopedInterface()
返回调用接口,如果该实例创建一个作用域的接口。
|
Modifier and Type | Method and Description |
---|---|
static Enumeration<NetworkInterface> |
NetworkInterface.getNetworkInterfaces()
返回此机器上的所有接口。
|
Enumeration<NetworkInterface> |
NetworkInterface.getSubInterfaces()
所有的子接口获取枚举(也称为虚拟接口)连接到这个网络接口。
|
Modifier and Type | Method and Description |
---|---|
static Inet6Address |
Inet6Address.getByAddress(String host, byte[] addr, NetworkInterface nif)
创建一个在
InetAddress.getByAddress(String,byte[]) Inet6Address确切的方式除了IPv6 scope_id设置,给出了相应的规定
addr 地址类型接口的价值。
|
boolean |
InetAddress.isReachable(NetworkInterface netif, int ttl, int timeout)
测试是否该地址是可到达的。
|
void |
MulticastSocket.joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
在指定的接口中加入指定的多播组。
|
protected abstract void |
DatagramSocketImpl.joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
加入多播组。
|
void |
MulticastSocket.leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf)
在指定的本地接口上留下多播组。
|
protected abstract void |
DatagramSocketImpl.leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf)
离开组播组。
|
void |
MulticastSocket.setNetworkInterface(NetworkInterface netIf)
指定发送多播数据报套接字的网络接口上发送。
|
Modifier and Type | Method and Description |
---|---|
abstract NetworkInterface |
MembershipKey.networkInterface()
返回创建此成员键的网络接口。
|
Modifier and Type | Method and Description |
---|---|
MembershipKey |
MulticastChannel.join(InetAddress group, NetworkInterface interf)
加入一个多播组开始接收所有的数据包发送到组,返回一个会员的关键。
|
MembershipKey |
MulticastChannel.join(InetAddress group, NetworkInterface interf, InetAddress source)
加入一个多播组开始接收从一个给定的源地址的数据包发送到组。
|
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.