efb258693d757afbc854de1e61d1b7bafd1ea429
[platform/upstream/curl.git] / docs / libcurl / opts / CURLOPT_TCP_NODELAY.3
1 .\" **************************************************************************
2 .\" *                                  _   _ ____  _
3 .\" *  Project                     ___| | | |  _ \| |
4 .\" *                             / __| | | | |_) | |
5 .\" *                            | (__| |_| |  _ <| |___
6 .\" *                             \___|\___/|_| \_\_____|
7 .\" *
8 .\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
9 .\" *
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
13 .\" *
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
17 .\" *
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
20 .\" *
21 .\" **************************************************************************
22 .\"
23 .TH CURLOPT_TCP_NODELAY 3 "19 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
24 .SH NAME
25 CURLOPT_TCP_NODELAY \- set the TCP_NODELAY option
26 .SH SYNOPSIS
27 #include <curl/curl.h>
28
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TCP_NODELAY, long nodelay);
30 .SH DESCRIPTION
31 Pass a long specifying whether the TCP_NODELAY option is to be set or cleared
32 (1 = set, 0 = clear). The option is cleared by default. This will have no
33 effect after the connection has been established.
34
35 Setting this option will disable TCP's Nagle algorithm. The purpose of this
36 algorithm is to try to minimize the number of small packets on the network
37 (where "small packets" means TCP segments less than the Maximum Segment Size
38 (MSS) for the network).
39
40 Maximizing the amount of data sent per TCP segment is good because it
41 amortizes the overhead of the send. However, in some cases small segments may
42 need to be sent without delay. This is less efficient than sending larger
43 amounts of data at a time, and can contribute to congestion on the network if
44 overdone.
45 .SH DEFAULT
46 0
47 .SH PROTOCOLS
48 All
49 .SH EXAMPLE
50 TODO
51 .SH AVAILABILITY
52 Always
53 .SH RETURN VALUE
54 Returns CURLE_OK
55 .SH "SEE ALSO"
56 .BR CURLOPT_SOCKOPTFUNCTION "(3), " CURLOPT_TCP_KEEPALIVE "(3), "