curl_easy_upkeep.3
imports <curl/curl.h>Uses libcurl for HTTP communication
SHA-256eb178612ab6df13dd1403a122b69809cb6e31bfbfbe9000d500326cff0eeab8e
MaleculeH(Cm)Md(In)
Evidence
⋯4 lines
5.SH SYNOPSIS
6.nf
7#include <curl/curl.h>
8
9CURLcode curl_easy_upkeep(CURL *handle);
10.fi
11.SH DESCRIPTION
12Some protocols have "connection upkeep" mechanisms. These mechanisms usually
13send some traffic on existing connections in order to keep them alive; this
14can prevent connections from being closed due to overzealous firewalls, for
15example.
16
17Currently the only protocol with a connection upkeep mechanism is HTTP/2: when
18the connection upkeep interval is exceeded and \fIcurl_easy_upkeep(3)\fP
19is called, an HTTP/2 PING frame is sent on the connection.
20
21This func …
23:22… ERVAL_MS(3)\fP.
24.SH EXAMPLE
25.nf
26int main(void)
27{
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 /* Make a connection to an HTTP/2 server. */
31 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
32
33 /* Set the interval to 30000ms / 30s */
34 curl_easy_setopt(curl, CURLOPT_UPKEEP_INTERVAL_MS, 30000L);
35
36 curl_easy_perform(curl);
37
38 /* Perform more work here. */
39
40 /* While the connection is being held open, curl_easy_upkeep() can be
41 cal …
45 /* Perform more work here. */
46
47 /* always cleanup */
48 curl_easy_cleanup(curl);
49 }
50}
⋯7 lines