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
inix::sys::socket::sockopt add Linux's TCP_DEFER_ACCEPT. #2106
base: master
Are you sure you want to change the base?
Conversation
src/sys/socket/sockopt.rs
Outdated
@@ -797,6 +797,17 @@ sockopt_impl!( | |||
libc::accept_filter_arg | |||
); | |||
#[cfg(target_os = "linux")] | |||
sockopt_impl!( | |||
/// Defers completion on accept so only when data arrives. |
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.
Could you try to reword this? The first sentence isn't grammatically correct. The second sentence's x
refers to a variable that isn't anywhere in the prototype. Probably "the number of seconds" would be better. And how would one use this after listen(2), given that listen blocks?
To your last point and why this option can be set before or after listen : Note however SO_ACCEPTFILTER is always after listen. |
Sorry; when I said "use this after listen", I was thinking "use this after accept". Yes, it can be used after listen(), but what does that have to do with portability? |
I wrote it for two reasons, to highlight this difference between TCP_DEFER_ACCEPT and SO_ACCEPTFILTER but also I think when you want to implement this feature for those platforms it s somehow better to do both after listen like NGINX does. |
Why would it be better do to it after listen than before, if it only has an effect on the behavior of accept? |
feature wise it changes nothing indeed, just grouping implementations look better in my opinion. |
Then why did you say "the latter is better for portable workflows"? It isn't portable at all, regardless of the order. |
07e5d96
to
9ea00c6
Compare
No description provided.