Skip to content

Commit

Permalink
Set keep alive on
Browse files Browse the repository at this point in the history
Signed-off-by: Nate Koenig <[email protected]>
  • Loading branch information
Nate Koenig committed Dec 4, 2020
1 parent 890b79d commit 11dbf7b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/RestClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ RestResponse Rest::Request(HttpMethod _method,
}
}

// enable TCP keep-alive for this transfer
curl_easy_setopt(curl, CURLOPT_TCP_KEEPALIVE, 1L);

// keep-alive idle time to 120 seconds
curl_easy_setopt(curl, CURLOPT_TCP_KEEPIDLE, 120L);

// interval time between keep-alive probes: 60 seconds
curl_easy_setopt(curl, CURLOPT_TCP_KEEPINTVL, 60L);

curl_easy_setopt(curl, CURLOPT_USERAGENT, this->userAgent.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

Expand Down

0 comments on commit 11dbf7b

Please sign in to comment.