diff --git a/src/share/classes/java/net/NetworkInterface.java b/src/share/classes/java/net/NetworkInterface.java index b6cd711bb1becf22d4cdaa48cf47015103d9b6d3..aa8e0bcffcfb5a7595a7a96ab13665da6205d41e 100644 --- a/src/share/classes/java/net/NetworkInterface.java +++ b/src/share/classes/java/net/NetworkInterface.java @@ -326,8 +326,10 @@ public final class NetworkInterface { } /** - * Returns all the interfaces on this machine. Returns null if no - * network interfaces could be found on this machine. + * Returns all the interfaces on this machine. The {@code Enumeration} + * contains at least one element, possibly representing a loopback + * interface that only supports communication between entities on + * this machine. * * NOTE: can use getNetworkInterfaces()+getInetAddresses() * to obtain all IP addresses for this node diff --git a/src/share/classes/java/net/package.html b/src/share/classes/java/net/package.html index c0146760d4da52429413c2a0604546f42e1e6bd4..b5bd261be9ff5b99a0aafdbbd972f7148944cbd0 100644 --- a/src/share/classes/java/net/package.html +++ b/src/share/classes/java/net/package.html @@ -65,6 +65,7 @@ Provides the classes for implementing networking applications.
Sending and receiving with TCP sockets is done through InputStreams and OutputStreams which can be obtained via the {@link java.net.Socket#getInputStream} and {@link java.net.Socket#getOutputStream} methods.
The {@link java.net.NetworkInterface} class provides APIs to browse and query all the networking interfaces (e.g. ethernet connection or PPP endpoint) of the local machine. It is through that class that you can check if any of the local interfaces is configured to support IPv6.
+Note, all conforming implementations must support at least one {@code NetworkInterface} object, which must either be connected to a network, or be a "loopback" interface that can only communicate with entities on the same machine.
A number of classes in the java.net package do provide for a much higher level of abstraction and allow for easy access to resources on the network. The classes are: