-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Fix Error in hostByName with low timeout #7585
Conversation
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.
That would be too much a breaking change.
What would be acceptable is to extend IPAddress::isSet()
to return false
for both INADDR_ANY
and INADDR_NONE
.
Also, nothing against a new IPAddress::clear()
method that would set to INADDR_ANY
.
Note that INADDR_NONE
is considered to be an obsolete use of this 255.255.255.255
address that is however a valid address.
Don't understand why it would be a breaking change |
Consider this: The right way is to check the return value of the function. |
Yes understood. |
The best solution is to read |
Agree. |
I think it is safe to
|
core 2.7.4.2 includes some backports from arduino / master esp8266/Arduino#7547 esp8266/Arduino#7586 esp8266/Arduino#7585 esp8266/Arduino#7595
Before,
aResult
was set toINADDR_NONE
, so255.255.255.255
(broadcast). When timeout was too low and callback didn't fire, theaResult.isSet()
line returned always true and that's not the correct behaviour.Even thought I'm not a native speaker,
INADDR_ANY
andINADDR_NONE
are confusing me.Whenever I think about it, I always associate
INADDR_NONE
with 0.0.0.0 andINADDR_ANY
with255.255.255.255
, but it's the other way.Also lwIP has the same scheme.
I would like to ask if we can add a
clear
method toIPAddress
like did toString
class (maybe in another PR) to resolve any doubts.