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:RE: [EXTERNAL] Re:Re: [HELP] What's the underlying connection reusing policy, can it be RR

From: 白水月 via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 23 Jan 2022 10:55:26 +0800 (CST)

What I was doing is to send keepalive requests to the server. I'm just wondering if there is a more graceful solution.
Anyway, thanks for your solution.













--
Best wishes!
At 2022-01-21 02:10:46, "Max Dymond" <max.dymond_at_microsoft.com> wrote:
>> Thanks for your reply,.<br/><br/>Yes, I don't do repeated request. Maybe come a request, then next one come an hour later. But the requests are latency concered(should be less than 50ms) . <br/><br/>If every request comes, then make a new connection to the server, the total cost of the request would probably exceed 50ms due to tcp handshake.<br/><br/>So I hope to keep the underlying connection in libcurl cache to stay as long as possible, such that once a request comes, <br/>there's a 'ready' connection(no need to establish from srcatch) to handle it.
>
>
>Are you using HTTP/2 or plain HTTP?  For HTTP/2 there's https://curl.se/libcurl/c/curl_easy_upkeep.html which is designed to keep a long-lived connection alive to a server by sending periodic HTTP/2 PING frames.
>
>Otherwise it sounds like you might have to configure the TCP keepalive settings of the host to keep the connection alive for longer; or, write your client in such a way that it periodically sends keepalive requests to the server (perhaps by sending OPTIONS to the server). 


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-01-23