Uses of Class
java.net.NetworkInterface
Package
Description
Provides the classes for implementing networking applications.
Defines channels, which represent connections to entities that are capable of
performing I/O operations, such as files and sockets; defines selectors, for
multiplexed, non-blocking I/O operations.
-
Uses of NetworkInterface in java.net
Modifier and TypeFieldDescriptionstatic final SocketOption<NetworkInterface>
StandardSocketOptions.IP_MULTICAST_IF
The network interface for Internet Protocol (IP) multicast datagrams.Modifier and TypeMethodDescriptionstatic NetworkInterface
NetworkInterface.getByIndex
(int index) Get a network interface given its index.static NetworkInterface
NetworkInterface.getByInetAddress
(InetAddress addr) Convenience method to search for a network interface that has the specified Internet Protocol (IP) address bound to it.static NetworkInterface
Searches for the network interface with the specified name.MulticastSocket.getNetworkInterface()
Get the multicast network interface set for outgoing multicast datagrams sent from this socket.NetworkInterface.getParent()
Returns the parent NetworkInterface of this interface if this is a subinterface, ornull
if it is a physical (non virtual) interface or has no parent.Inet6Address.getScopedInterface()
Returns the scoped interface, if this instance was created with a scoped interface.Modifier and TypeMethodDescriptionstatic Enumeration<NetworkInterface>
NetworkInterface.getNetworkInterfaces()
Returns anEnumeration
of all the interfaces on this machine.NetworkInterface.getSubInterfaces()
Get an Enumeration with all the subinterfaces (also known as virtual interfaces) attached to this network interface.static Stream<NetworkInterface>
NetworkInterface.networkInterfaces()
Returns aStream
of all the interfaces on this machine.NetworkInterface.subInterfaces()
Get a Stream of all subinterfaces (also known as virtual interfaces) attached to this network interface.Modifier and TypeMethodDescriptionstatic Inet6Address
Inet6Address.getByAddress
(String host, byte[] addr, NetworkInterface nif) Create an Inet6Address in the exact manner ofInetAddress.getByAddress(String,byte[])
except that the IPv6 scope_id is set to the value corresponding to the given interface for the address type specified inaddr
.boolean
InetAddress.isReachable
(NetworkInterface netif, int ttl, int timeout) Test whether that address is reachable.void
DatagramSocket.joinGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Joins a multicast group.protected abstract void
DatagramSocketImpl.joinGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Join the multicast group.void
MulticastSocket.joinGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Joins a multicast group.void
DatagramSocket.leaveGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Leave a multicast group on a specified local interface.protected abstract void
DatagramSocketImpl.leaveGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Leave the multicast group.void
MulticastSocket.leaveGroup
(SocketAddress mcastaddr, NetworkInterface netIf) Leave a multicast group on a specified local interface.void
MulticastSocket.setNetworkInterface
(NetworkInterface netIf) Specify the network interface for outgoing multicast datagrams sent on this socket. -
Uses of NetworkInterface in java.nio.channels
Modifier and TypeMethodDescriptionabstract NetworkInterface
MembershipKey.networkInterface()
Returns the network interface for which this membership key was created.Modifier and TypeMethodDescriptionMulticastChannel.join
(InetAddress group, NetworkInterface interf) Joins a multicast group to begin receiving all datagrams sent to the group, returning a membership key.MulticastChannel.join
(InetAddress group, NetworkInterface interf, InetAddress source) Joins a multicast group to begin receiving datagrams sent to the group from a given source address.