-
-
Notifications
You must be signed in to change notification settings - Fork 7k
An attempt to improve Yun's discovery #2658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
boolean reachable = false; | ||
for (Integer port : ports) { | ||
reachable = reachable || NetUtils.isReachable(inetAddress, port); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop always check for 80 and 22, it may be rewritten as:
reachable = false;
for (Integer port : ports) {
if (NetUtils.isReachable(inetAddress, port)) {
reachable = true;
break;
}
}
so it stops at the first successful check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After @roadfun comment, I've changed &&
to a ||
. This way the loop will spin but it won't run isReachable
any more as soon as one returns true
Tried both "macosx" download links. When I unzip the files in both cases I get a mess that Arduino has been damaged and should be moved to the trash. So I can't test this build. |
I can download and unpack it successfully but I'll trigger another build |
@ArduinoBot build this please |
…ersions Refactored NetUtils.isReachable to two functions: isReachableByEcho and isPortOpen If the first one will fail, the second one will be used
Since InetAddress.isReachable is reported to be reliable on mac, I've merged both ways into NetUtils (see https://github.com/ffissore/Arduino/commit/0990f98b1430bdd79022d48981f91ddf354bae78) |
Sorry Federico but this doesn't work for me either. I checked the Console log and launching the app gives an error I've never seen before, and a quick web search didn't turn up any clue. I'd have to do some digging to figure out why it doesn't work if it works for you. Only thing I can guess is some sort of security/sandbox issue. But I don't have any problem downloading and running the official build. 2/19/15 8:41:30.753 AM CoreServicesUIAgent[2653]: Error -60005 creating authorization |
Ah maybe it's because osx treat the app as unsecure because you've downloaded and it's not signed (automated builds are not signed, only releases are) |
My usual trick for opening unsigned apps didn't work. I'll do some more searching. |
Figured out the work around - in this case it requires changing the system setting to allow any app to run. The single-app exceptions doesn't work. Having solved that problem. I think this build works as well as the version I created. I still some issues (e.g. sometimes no Yuns are shown at all) but those are common between your build and mine. Definitely this fixes the "port 80 not open" problem. |
Good! Thanks for all your work and feedback :) |
An attempt to improve Yun's discovery
Thanks @roadfun. See #2576
/cc @cmaglie