Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Libcurl C++ でロング ポーリング クライアントを作成しました
次の方法でタイムアウトを 30 秒に設定します。
curl_easy_setopt(longPollingHandle, CURLOPT_TIMEOUT, 30L);
操作がタイムアウトした後、HTTP get 要求を再発行するにはどうすればよいですか?
ありがとう
興味のある方はどうぞ。
CURLcode のステータスを確認しました。!= 0 の場合は、リクエストを再発行します。
if(res != 0) { cout << "Timeout : Repolling " << endl; continue; }
続行すると、curl_easy_perform を再度発行するループの先頭に戻ります。