Skip to content
uencoder

TCP Uncork

TCP uncork cancels the TCP_CORK hold and immediately sends all buffered data.

Purpose

It explicitly flushes the send buffer after corking has batched the data, ensuring a timely send.

Mechanism

After setting TCP_CORK=0, the kernel immediately transmits every buffered segment. The usual pattern is cork → multiple writes → uncork to achieve batched sending.

Use cases

  • Flushing after batching
  • Merging HTTP headers and body
  • Bulk send control

Related tools

References