Open rbjorklin opened 2 weeks ago
I went looking around and found a discussion on the dotnet runtime about adding this feature Socket support for TCP_QUICKACK. They decided against it, because there was no good cross-platform support, and couldn't settle on a portable way to expose the feature to their users.
For what it's worth this is available at the system level when using systemd >= 253.
It is also possible to modify existing routes to force quickack for any connection using said route.
ip -4 route show scope link | while read route ; do
ip route change ${route} quickack 1
done
I wonder who would want to make a decision on this question. Maybe @xavierleroy or @damiendoligez?
Given that workarounds exist I would be fine with this being closed as “won’t do”.
If accepted this PR adds the
TCP_QUICKACK
socket option.TCP_QUICKACK
can be of use on low latency networks where a socket buffer may not fill up in the hard coded 200ms window. SettingTCP_QUICKACK
will cause acknowledgements to be sent immediately.PS. This PR was heavily inspired by #9869 and I'm not convinced I did everything correctly. For example it is not clear to me why the
TCP_NODELAY
macro exists insockopt_unix.c
but not insockopt_win32.c
and because I don't understand I opted to not add the macro tosockopt_win32.c
.EDIT: The build failed without the macro in
sockopt_win32.c
so I ended up adding it after all.