Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The following table describes IPPROTO_TCP Socket Options. IPPROTO_TCP is documented for backward compatibility with Winsock 1.1. See getsockoptand setsockoptfor more information on getting and setting socket options. To enumerate protocols and discover supported properties for each installed protocol, use the WSAEnumProtocolsfunction.
Some socket options require more explanation than these tables can convey; such options contain links to additional pages.
IPPROTO_TCP
Option | get/set | Optval Type | Description |
---|---|---|---|
TCP_NODELAY |
both |
BOOL |
Enables or disables the Nagle algorithm for TCP sockets. Enabled by default. The Nagle algorithm is disabled if the TCP_NODELAY option is enabled, and the reverse is true as well. |
Note: |
---|
Application writers should not set TCP_NODELAY unless the impact of doing so is well understood and desired because setting TCP_NODELAY can have a significant negative impact on network and application performance. |
The Nagle algorithm (described in RFC 896) is effective in reducing the number of small packets sent by a host. The process involves buffering senddata when there is unacknowledged data already in flight, or buffering send data until a full-size packet can be sent. It is highly recommended that Windows Sockets implementations enable the Nagle Algorithm by default because the algorithm can deliver significant performance enhancements. However, for applications where many small messages are sent, and the time delays between the messages are maintained, this algorithm can impede performance. In this case, setsockoptwith TCP_NODELAY can be used to turn it off.