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 _CgHttpPersistentConnection CgHttpPersistentConnection
typedef _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 CgHttpPersistentConnectionListcache = NULL
static CgMutexpersistent_connection_mutex = NULL

Define Documentation

#define CG_HTTP_PERSISTENT_CACHE_SIZE   5

#define CG_HTTP_PERSISTENT_TIMEOUT_PERIOD   60


Typedef Documentation

typedef struct _CgHttpPersistentConnection CgHttpPersistentConnection

typedef struct _CgHttpPersistentConnection CgHttpPersistentConnectionList


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

CgHttpPersistentConnectionList* cache = NULL [static]

CgMutex* persistent_connection_mutex = NULL [static]


Generated on Tue Aug 8 14:56:29 2006 for CyberLinkC by  doxygen 1.4.7