cp_httpclient_ctl *cp_httpclient_ctl_create(int background);
void cp_httpclient_ctl_destroy(cp_httpclient_ctl *ctl);
struct pollfd *
cp_httpclient_ctl_get_pollfds(cp_httpclient_ctl *ctl, int *num);
cp_httpclient_ctl_create creates a new execution stack. The background parameter determines the number of threads made available for processing requests. If background is 1, a background thread is started to process requests on the created controller. If background is 2 or higher, a thread pool is created to process requests with the parameter value used as the maximal pool size. If background is zero, no additional threads are started, and requests must be driven by calls to cp_httpclient_fetch_ctl_exec(3). In this case applications should poll on the struct pollfd array returned by cp_httpclient_ctl_get_pollfds with a non-zero value to prevent spinning on the call to cp_httpclient_ctl_exec. If not NULL, the num parameter to cp_httpclient_ctl_get_pollfds is set to the number of entries in the struct pollfd array.
cp_httpclient_ctl_destroy stops any threads associated with a cp_httpclient_ctl object and performs clean up.
cp_httpclient_ctl_get_pollfds returns an array of struct pollfd objects which may be used in a call to poll(2) or NULL on a memory allocation failure or if the transfer control stack contains no entries. In addition, if not NULL the num parameter is set to the number of entries in the array.
This document was created by
using the manual pages.
Time: 23:42:32 GMT, May 09, 2006