cp_socket

Section: cp_httpclient (3)
Updated: MAY 2006
Index Return to Main Contents
 

NAME

cp_httpclient_create, cp_httpclient_create_proxy, cp_httpclient_create_ssl, cp_httpclient_create_proxy_ssl, cp_httpclient_destroy, cp_httpclient_reopen - http client wrapper constructor / destructor functions

 

SYNOPSIS

#include <cprops/httpclient.h>

cp_httpclient *cp_httpclient_create(char *host, int port);
cp_httpclient *
      cp_httpclient_create_proxy(char *host, int port,
                                 char *proxy_host, int proxy_port);
cp_httpclient *cp_httpclient_create_ssl(char *host, int port,
                                         char *CA_file, char *CA_path,
                                         int verification_mode);
cp_httpclient *
      cp_httpclient_create_proxy_ssl(char *host, int port,
                                     char *proxy_host, int proxy_port),

                                     char *CA_file, char *CA_path,
                                     int verification_mode);
void cp_httpclient_destroy(cp_httpclient *client);

int cp_httpclient_reopen(cp_httpclient *client, char *host, int port);  

DESCRIPTION

cp_httpclient represents a tcp connection to a specific host on a specific port and other information required to relay HTTP requests and retrieve server responses.

cp_httpclient_create creates a client wrapper for the requested host and port. Creation will fail if the requested host can not be found.
cp_httpclient_create_proxy creates a client wrapper for the requested host and port, but connects instead to the requested proxy_host and therefore creation will fail if the proxy_host cannot be found, and may succeed even if the requested host does not exist.

cp_httpclient_create_ssl creates a client using the certificates given in the CA_file or under the CA_path parameter. A value of SSL_VERIFY_PEER or SSL_VERIFY_NONE must be provided for the verification_mode parameter.
cp_httpclient_create_proxy_ssl will create an ssl connection to the proxy.

cp_httpclient_create_ssl and cp_httpclient_create_proxy_ssl are available if libcprops was configured to use ssl (default).

cp_httpclient_destroy closes the underlying connection if it is open and deallocates the client object.

cp_httpclient_reopen reassigns a client object for a different host:port pair.  

RETURN VALUE

cp_httpclient_create, cp_httpclient_create_proxy, cp_httpclient_create_ssl and cp_httpclient_create_proxy_ssl return a newly created client object or NULL on memory allocation failure or if the requested host or proxy host could not be found.

cp_httpclient_reopen returns zero on success or -1 on memory allocation failures or if the new host could not be found.


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE

This document was created by man2html, using the manual pages.
Time: 23:42:32 GMT, May 09, 2006
SourceForge.net Logo