nix icon indicating copy to clipboard operation
nix copied to clipboard

inix::sys::socket::sockopt add Linux's TCP_DEFER_ACCEPT.

Open devnexen opened this issue 2 years ago • 6 comments
trafficstars

devnexen avatar Aug 27 '23 09:08 devnexen

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.

devnexen avatar Aug 27 '23 19:08 devnexen

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?

asomers avatar Aug 27 '23 21:08 asomers

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.

devnexen avatar Aug 27 '23 21:08 devnexen

Why would it be better do to it after listen than before, if it only has an effect on the behavior of accept?

asomers avatar Aug 27 '23 21:08 asomers

feature wise it changes nothing indeed, just grouping implementations look better in my opinion.

devnexen avatar Aug 28 '23 06:08 devnexen

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.

asomers avatar Aug 28 '23 13:08 asomers