// bound to it. For these tests only work with NetworkInterface objects
// that are bound to an InetAddress.
if ((theInterfaces != null) && (theInterfaces.hasMoreElements())) {
while ((theInterfaces.hasMoreElements())
&& (atLeastOneInterface == false)) {
NetworkInterface theInterface = (NetworkInterface) theInterfaces
.nextElement();
if (theInterface.getInetAddresses() != null) {
// Ensure that the current NetworkInterface has at least
// one InetAddress bound to it.
Enumeration addrs = theInterface.getInetAddresses();
if ((addrs != null) && (addrs.hasMoreElements())) {
atLeastOneInterface = true;
networkInterface1 = theInterface;
}// end if
}
}
while ((theInterfaces.hasMoreElements())
&& (atLeastTwoInterfaces == false)) {
NetworkInterface theInterface = (NetworkInterface) theInterfaces
.nextElement();
if (theInterface.getInetAddresses() != null) {
// Ensure that the current NetworkInterface has at least
// one InetAddress bound to it.
Enumeration addrs = theInterface.getInetAddresses();
if ((addrs != null) && (addrs.hasMoreElements())) {
atLeastTwoInterfaces = true;
networkInterface2 = theInterface;
}// end if
}