You are on page 1of 1

When the TCP_CORK option is enabled on a TCP socket, all subsequent output is buffered into a single

TCP segment until either the upper limit on the size of a segment is reached, the TCP_CORK option is
disabled, the socket is closed, or a maximum of 200 milliseconds passes from the time that the first
corked byte is written. (The timeout ensures that the corked data is transmitted if the application forgets
to disable the TCP_CORK option.) We enable and disable the TCP_CORK option using the setsockopt()
system call (Section 61.9). The following code (which omits error checking) demonstrates the use of
TCP_CORK for our hypothetical HTTP server example:

You might also like