nix
nix copied to clipboard
inix::sys::socket::sockopt add Linux's TCP_DEFER_ACCEPT.
To your last point and why this option can be set before or after listen : 1/ one example is HAProxy listen is done below. 2/ another example is NGINX listen is in this case above.
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.
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.