4 ms·
This seems like it should be very simple to fix without having to do much to the API. Just implement a flush() function for TCP sockets that tells the stack to
by jandrese 4y ago
This seems like it should be very simple to fix without having to do much to the API. Just implement a flush() function for TCP sockets that tells the stack to kick the current buffer out to the wire immediately. It seems so obvious that I think I must be missing something. Why didn't this appear in the 80s?
- erik_seaberg 4y agoIt’s not portable but Linux has a TCP_CORK socket option that does this.
- olvy0 4y agoHere'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 https://stackoverflow.com/a/22118709
- jandrese 4y agoWow, that's not awkward at all.