Comment by erik_seaberg 3 years ago It’s not portable but Linux has a TCP_CORK socket option that does this. 2 comments erik_seaberg Reply olvy0 3 years ago Here's how to emulate TCP_CORK using TCP_NODELAY, from [0]:- unset the TCP_NODELAY flag on the socket- Call send() zero or more times to add your outgoing data into the Nagle-queue- set the TCP_NODELAY flag on the socket- call send() with the number-of-bytes argument set to zero, to force an immediate send of the Nagle-queued data[0] https://stackoverflow.com/a/22118709 jandrese 3 years ago Wow, that's not awkward at all.
olvy0 3 years ago Here's how to emulate TCP_CORK using TCP_NODELAY, from [0]:- unset the TCP_NODELAY flag on the socket- Call send() zero or more times to add your outgoing data into the Nagle-queue- set the TCP_NODELAY flag on the socket- call send() with the number-of-bytes argument set to zero, to force an immediate send of the Nagle-queued data[0] https://stackoverflow.com/a/22118709 jandrese 3 years ago Wow, that's not awkward at all.
Here's how to emulate TCP_CORK using TCP_NODELAY, from [0]:
- unset the TCP_NODELAY flag on the socket
- Call send() zero or more times to add your outgoing data into the Nagle-queue
- set the TCP_NODELAY flag on the socket
- call send() with the number-of-bytes argument set to zero, to force an immediate send of the Nagle-queued data
[0] https://stackoverflow.com/a/22118709
Wow, that's not awkward at all.