Compartilhar via


IPPROTO_TCP

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

The following table describes IPPROTO_TCP Socket Options. IPPROTO_TCP is documented for backward compatibility with Winsock 1.1. See getsockopt and setsockopt for more information on getting and setting socket options. To enumerate protocols and discover supported properties for each installed protocol, use the WSAEnumProtocols function.

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 send data 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, setsockopt with TCP_NODELAY can be used to turn it off.

See Also

Concepts

Socket Options