quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

CURLOPT_SERVER_RESPONSE_TIMEOUT_MS.md (1773B)


      1 ---
      2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
      3 SPDX-License-Identifier: curl
      4 Title: CURLOPT_SERVER_RESPONSE_TIMEOUT_MS
      5 Section: 3
      6 Source: libcurl
      7 See-also:
      8   - CURLOPT_CONNECTTIMEOUT (3)
      9   - CURLOPT_LOW_SPEED_LIMIT (3)
     10   - CURLOPT_TIMEOUT (3)
     11 Protocol:
     12   - FTP
     13   - IMAP
     14   - POP3
     15   - SMTP
     16   - SFTP
     17   - SCP
     18 Added-in: 8.6.0
     19 ---
     20 
     21 # NAME
     22 
     23 CURLOPT_SERVER_RESPONSE_TIMEOUT_MS - time allowed to wait for server response
     24 
     25 # SYNOPSIS
     26 
     27 ~~~c
     28 #include <curl/curl.h>
     29 
     30 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SERVER_RESPONSE_TIMEOUT_MS,
     31                           long timeout);
     32 ~~~
     33 
     34 # DESCRIPTION
     35 
     36 Pass a long. Causes libcurl to set a *timeout* period (in milliseconds) on the
     37 amount of time that the server is allowed to take in order to send a response
     38 message for a command before the session is considered dead. While libcurl is
     39 waiting for a response, this value overrides CURLOPT_TIMEOUT(3). It is
     40 recommended that if used in conjunction with CURLOPT_TIMEOUT(3), you set
     41 CURLOPT_SERVER_RESPONSE_TIMEOUT_MS(3) to a value smaller than
     42 CURLOPT_TIMEOUT(3).
     43 
     44 The maximum accepted value is 2147483648.
     45 
     46 This is the millisecond version of CURLOPT_SERVER_RESPONSE_TIMEOUT(3).
     47 
     48 # DEFAULT
     49 
     50 None
     51 
     52 # %PROTOCOLS%
     53 
     54 # EXAMPLE
     55 
     56 ~~~c
     57 int main(void)
     58 {
     59   CURL *curl = curl_easy_init();
     60   if(curl) {
     61     CURLcode res;
     62     curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/slow.txt");
     63     /* wait no more than 237 milliseconds */
     64     curl_easy_setopt(curl, CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, 237L);
     65     res = curl_easy_perform(curl);
     66 
     67     curl_easy_cleanup(curl);
     68   }
     69 }
     70 ~~~
     71 
     72 # %AVAILABILITY%
     73 
     74 # RETURN VALUE
     75 
     76 curl_easy_setopt(3) returns a CURLcode indicating success or error.
     77 
     78 CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
     79 libcurl-errors(3).