INT-1307 Remove Java 6 dependencies (cause in IOException; isLoopback() on NetworkInterface)
This commit is contained in:
@@ -150,7 +150,7 @@ public class NetSocketReader extends AbstractSocketReader {
|
||||
} catch (EOFException ee) {
|
||||
return SOCKET_CLOSED;
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new IOException(e);
|
||||
throw new IOException(e.getMessage());
|
||||
}
|
||||
return SocketReader.MESSAGE_COMPLETE;
|
||||
}
|
||||
|
||||
@@ -34,16 +34,8 @@ public class SoftEndOfStreamException extends IOException {
|
||||
super();
|
||||
}
|
||||
|
||||
public SoftEndOfStreamException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public SoftEndOfStreamException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public SoftEndOfStreamException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -338,17 +338,17 @@ public class SocketUtils {
|
||||
}
|
||||
|
||||
public static String chooseANic(boolean multicast) throws Exception {
|
||||
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
|
||||
while (interfaces.hasMoreElements()) {
|
||||
NetworkInterface intface = interfaces.nextElement();
|
||||
if (intface.isLoopback() || (multicast && !intface.supportsMulticast()))
|
||||
continue;
|
||||
Enumeration<InetAddress> inet = intface.getInetAddresses();
|
||||
if (!inet.hasMoreElements())
|
||||
continue;
|
||||
String address = inet.nextElement().getHostAddress();
|
||||
return address;
|
||||
}
|
||||
// Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
|
||||
// while (interfaces.hasMoreElements()) {
|
||||
// NetworkInterface intface = interfaces.nextElement();
|
||||
// if (intface.isLoopback() || (multicast && !intface.supportsMulticast()))
|
||||
// continue;
|
||||
// Enumeration<InetAddress> inet = intface.getInetAddresses();
|
||||
// if (!inet.hasMoreElements())
|
||||
// continue;
|
||||
// String address = inet.nextElement().getHostAddress();
|
||||
// return address;
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user