curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Setting TCP_NODELAY on socket

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 7 Jun 2019 02:57:29 -0400

On 6/6/2019 10:08 PM, Kunal Ekawde via curl-library wrote:
> If we use:
> curl_easy_setopt(easy_handle, CURLOPT_OPENSOCKETFUNCTION,
> CurlOpenSocketCallback);
>
> and in CurlOpenSocketCallback we open the tcp socket and set
> TCP_NODELAY for this socket using setsockopt and NOT USING
> CURLOPT_TCP_NODELAY, would it reset the flag, basically not use
> nodelay / enable nagles algorithm ?

No. tcpnodelay() [1] which sets TCP_NODELAY only turns it on, not off.

[1]: https://github.com/curl/curl/blob/curl-7_65_1/lib/connect.c#L900

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-06-07