Thanks for your constructive reply. Yet I do send a keepalive request to the 
server. It works something just like an "echo". 




--

Best wishes!




在 2022-01-23 18:46:14,"Daniel Stenberg" <dan...@haxx.se> 写道:
>On Sun, 23 Jan 2022, 白水月 wrote:
>
>> What I was doing is to send keepalive requests to the server. I'm just 
>> wondering if there is a more graceful solution.
>
>TCP keepalive is rarely enough to maintain a connection. It usually also 
>requires actual TCP traffic to go over it, which in the HTTP/2 case could be 
>PING frames like with curl_easy_upkeep(). Sometimes it will also require HTTP 
>requests to prevent the server from killing connections for being idle.
>
>If you're using HTTP/1 you instead can do "no-op" HTTP requests, such as HEAD 
>or OPTIONS.
>
>-- 
>
>  / daniel.haxx.se
>  | Commercial curl support up to 24x7 is available!
>  | Private help, bug fixes, support, ports, new features
>  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to