Annotation of embedaddon/curl/docs/libcurl/opts/CURLOPT_MAXAGE_CONN.3, revision 1.1.1.1

1.1       misho       1: .\" **************************************************************************
                      2: .\" *                                  _   _ ____  _
                      3: .\" *  Project                     ___| | | |  _ \| |
                      4: .\" *                             / __| | | | |_) | |
                      5: .\" *                            | (__| |_| |  _ <| |___
                      6: .\" *                             \___|\___/|_| \_\_____|
                      7: .\" *
                      8: .\" * Copyright (C) 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
                      9: .\" *
                     10: .\" * This software is licensed as described in the file COPYING, which
                     11: .\" * you should have received as part of this distribution. The terms
                     12: .\" * are also available at https://curl.haxx.se/docs/copyright.html.
                     13: .\" *
                     14: .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
                     15: .\" * copies of the Software, and permit persons to whom the Software is
                     16: .\" * furnished to do so, under the terms of the COPYING file.
                     17: .\" *
                     18: .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
                     19: .\" * KIND, either express or implied.
                     20: .\" *
                     21: .\" **************************************************************************
                     22: .\"
                     23: .TH CURLOPT_MAXAGE_CONN 3 "April 14, 2019" "libcurl 7.70.0" "curl_easy_setopt options"
                     24: 
                     25: .SH NAME
                     26: CURLOPT_MAXAGE_CONN \- max idle time allowed for reusing a connection
                     27: .SH SYNOPSIS
                     28: #include <curl/curl.h>
                     29: 
                     30: CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXAGE_CONN, long maxage);
                     31: .SH DESCRIPTION
                     32: Pass a long as parameter containing \fImaxage\fP - the maximum time in seconds
                     33: that you allow an existing connection to have to be considered for reuse for
                     34: this request.
                     35: 
                     36: The "connection cache" that holds previously used connections. When a new
                     37: request is to be done, it will consider any connection that matches for
                     38: reuse. The \fICURLOPT_MAXAGE_CONN(3)\fP limit prevents libcurl from trying
                     39: very old connections for reuse, since old connections have a high risk of not
                     40: working and thus trying them is a performance loss and sometimes service loss
                     41: due to the difficulties to figure out the situation. If a connection is found
                     42: in the cache that is older than this set \fImaxage\fP, it will instead be
                     43: closed.
                     44: .SH DEFAULT
                     45: Default maxage is 118 seconds.
                     46: .SH PROTOCOLS
                     47: All
                     48: .SH EXAMPLE
                     49: .nf
                     50: CURL *curl = curl_easy_init();
                     51: if(curl) {
                     52:   curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
                     53: 
                     54:   /* only allow 30 seconds idle time */
                     55:   curl_easy_setopt(curl, CURLOPT_MAXAGE_CONN, 30L);
                     56: 
                     57:   curl_easy_perform(curl);
                     58: }
                     59: .fi
                     60: .SH AVAILABILITY
                     61: Added in libcurl 7.65.0
                     62: .SH RETURN VALUE
                     63: Returns CURLE_OK.
                     64: .SH "SEE ALSO"
                     65: .BR CURLOPT_TIMEOUT "(3), " CURLOPT_FORBID_REUSE "(3), "
                     66: .BR CURLOPT_FRESH_CONNECT "(3), "

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>