Skip to content

net: Track state of setNoDelay and prevent unnecessary system calls.

The state of .setNoDelay() is now tracked and code will prevent repeated system calls to setsockopt() when the value has already been set to the desired value for the socket.

Change and expand the appropriate test.

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Rationale

The reason for this change is that if setNoDelay is set in a HTTP options request such as in #31539 , there will be repeated syscalls to .setNoDelay(true) which in turn will cause many calls to setsockopt() that are unnecessary since the socket has already been set to disable Nagle's algorithm.

Merge request reports

Loading