mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
InetAddress.isReachable is reported reliable on mac and recent java versions
Refactored NetUtils.isReachable to two functions: isReachableByEcho and isPortOpen If the first one will fail, the second one will be used
This commit is contained in:
@ -75,10 +75,7 @@ public class NetworkDiscovery implements Discovery, ServiceListener, cc.arduino.
|
||||
ports.add(0, 22);
|
||||
}
|
||||
|
||||
boolean reachable = false;
|
||||
for (Integer port : ports) {
|
||||
reachable = reachable || NetUtils.isReachable(inetAddress, port);
|
||||
}
|
||||
boolean reachable = NetUtils.isReachable(inetAddress, ports);
|
||||
if (!reachable) {
|
||||
boardPortIterator.remove();
|
||||
}
|
||||
|
Reference in New Issue
Block a user