Skip to content
Snippets Groups Projects
Commit 443859cd authored by mikita's avatar mikita
Browse files

fixed to check if network interface is up or not

parent db09d9bc
Branches
Tags
No related merge requests found
...@@ -52,8 +52,14 @@ public class InetAddressFactory { ...@@ -52,8 +52,14 @@ public class InetAddressFactory {
} }
List<InetAddress> inetAddresses = Lists.newArrayList(); List<InetAddress> inetAddresses = Lists.newArrayList();
for (NetworkInterface networkInterface : networkInterfaces) { for (NetworkInterface networkInterface : networkInterfaces) {
try{
if (networkInterface.isUp()) {
inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses())); inetAddresses.addAll(Collections.list(networkInterface.getInetAddresses()));
} }
} catch (SocketException e) {
throw new RosRuntimeException(e);
}
}
return inetAddresses; return inetAddresses;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment