chttp_persistent_connection.c File Reference

#include <cybergarage/util/clist.h>
#include <cybergarage/util/ctime.h>
#include <cybergarage/util/cmutex.h>
#include <cybergarage/http/chttp.h>
#include <cybergarage/net/csocket.h>
#include <cybergarage/util/clog.h>

Data Structures

struct  _CgHttpPersistentConnection

Defines

#define CG_HTTP_PERSISTENT_CACHE_SIZE   5
#define CG_HTTP_PERSISTENT_TIMEOUT_PERIOD   60

Typedefs

typedef struct
_CgHttpPersistentConnection 
CgHttpPersistentConnection
typedef struct
_CgHttpPersistentConnection 
CgHttpPersistentConnectionList

Functions

BOOL cg_http_persistentconnection_init (void)
CgHttpPersistentConnectioncg_http_persistentconnection_new (void)
void cg_http_persistentconnection_delete (CgHttpPersistentConnection *node)
void * cg_http_persistentconnection_get (char *host, int port)
BOOL cg_http_persistentconnection_put (char *host, int port, void *data)
void cg_http_persistentconnection_clear (void)
void cg_http_persistentconnection_lock (void)
void cg_http_persistentconnection_unlock (void)

Variables

static
CgHttpPersistentConnectionList
cache = NULL
static CgMutexpersistent_connection_mutex = NULL

Define Documentation

#define CG_HTTP_PERSISTENT_CACHE_SIZE   5
#define CG_HTTP_PERSISTENT_TIMEOUT_PERIOD   60

Typedef Documentation


Function Documentation

void cg_http_persistentconnection_clear ( void   ) 

Clear persistent connection cache and free all memory

void cg_http_persistentconnection_delete ( CgHttpPersistentConnection node  ) 
void* cg_http_persistentconnection_get ( char *  host,
int  port 
)

Get persistent connection from cache

BOOL cg_http_persistentconnection_init ( void   ) 

Initialize persistent connection cache. Can be called many times

void cg_http_persistentconnection_lock ( void   ) 

Lock persistent connection cache. Required for getting, putting and using persistent connection from cache

CgHttpPersistentConnection* cg_http_persistentconnection_new ( void   ) 
BOOL cg_http_persistentconnection_put ( char *  host,
int  port,
void *  data 
)

Put connection to persistent connection cache

void cg_http_persistentconnection_unlock ( void   ) 

Unlock persistent connection cache.


Variable Documentation


Generated on Tue Feb 23 23:14:23 2010 for CyberLink for C by  doxygen 1.6.1