-
Notifications
You must be signed in to change notification settings - Fork 68
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: replace is_connect_failed with is_err #189
Fix: replace is_connect_failed with is_err #189
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.
Unfortunately we can't change is_connect_failed
as that would be a breaking change. So we have to keep the name the same there.
I apologize for my previous mistake. I would like to have your opinion on whether it is better to add I would argue that the first approach is better, as it aligns with the semantics it provides. |
I'd argue that the first would be better. |
…volution/polling into fix-detect-connection-fail
…volution/polling into fix-detect-connection-fail
5d26a29
to
d0f8206
Compare
examples/tcp_client.rs
Outdated
@@ -1,36 +1,155 @@ | |||
use std::{io, net}; |
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.
I would appreciate not changing this example and instead just wrapping the socket error bits in the configuration guards.
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.
can you elaborate what you mean by that?
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.
Don't modify the Example too much; just make it so the is_err
-specific code is guarded.
please have a look again, I am not exactly sure if this is how you want it. |
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.
Overall LGTM, just some minor considerations regarding docs.
Co-authored-by: John Nunley <[email protected]>
Co-authored-by: John Nunley <[email protected]>
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.
LGTM aside from one minor nitpick
Co-authored-by: John Nunley <[email protected]>
😢 , @notgull could you please help me look at the wine CI thing? I have no idea how that works |
Looks like a spurious error. |
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.
Thanks!
In linux, epoll, EPOLLHUP may happen even if no connection call is made. It would confuse callers for what is actually happening.
Replaced is_connect_failed, and we detect if connection failed by using the combination of is_err and is_interrupt, please see the example, tcp_client