xjab_util.h File Reference

#include "xjab_base.h"
#include "xjab_jcon.h"
#include "../../str.h"

Include dependency graph for xjab_util.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _xj_jcon_pool
struct  _xj_jmsg_queue

Typedefs

typedef struct _xj_jcon_pool t_xj_jcon_pool
typedef struct _xj_jmsg_queue t_xj_jmsg_queue
typedef struct _xj_jcon_poolxj_jcon_pool
typedef struct _xj_jmsg_queuexj_jmsg_queue

Functions

void xj_jccon_pool_free (xj_jcon_pool)
int xj_jcon_pool_add (xj_jcon_pool, xj_jcon)
int xj_jcon_pool_add_jmsg (xj_jcon_pool, xj_sipmsg, xj_jcon)
int xj_jcon_pool_del (xj_jcon_pool, xj_jkey)
int xj_jcon_pool_del_jmsg (xj_jcon_pool, int)
xj_jcon xj_jcon_pool_get (xj_jcon_pool, xj_jkey)
xj_jcon_pool xj_jcon_pool_init (int, int, int)
void xj_jcon_pool_print (xj_jcon_pool)


Typedef Documentation

typedef struct _xj_jcon_pool t_xj_jcon_pool

typedef struct _xj_jcon_pool * xj_jcon_pool

typedef struct _xj_jmsg_queue * xj_jmsg_queue


Function Documentation

void xj_jccon_pool_free ( xj_jcon_pool   ) 

int xj_jcon_pool_add ( xj_jcon_pool  jcp,
xj_jcon  jc 
)

add a new connection in pool

  • jcp : pointer to the Jabber connections pool structure return : 0 on success or <0 on error

Definition at line 149 of file xjab_util.c.

References _xj_jcon_pool::len, len, LM_DBG, NULL, and _xj_jcon_pool::ojc.

Referenced by xj_worker_process().

int xj_jcon_pool_add_jmsg ( xj_jcon_pool  jcp,
xj_sipmsg  _jsm,
xj_jcon  _ojc 
)

add a new element in messages queue

  • jcp : pointer to the Jabber connections pool structure
  • _jsm : pointer to the message
  • _ojc : pointer to the Jabber connection that will be used for this message return : 0 on success or <0 on error

Definition at line 101 of file xjab_util.c.

References _xj_jmsg_queue::cache, _xj_jmsg_queue::expire, get_ticks(), _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, _xj_jmsg_queue::len, LM_DBG, NULL, _xj_jmsg_queue::ojc, and _xj_jmsg_queue::size.

Referenced by xj_worker_process().

int xj_jcon_pool_del ( xj_jcon_pool  jcp,
xj_jkey  jkey 
)

remove the connection associated with 'id' from pool

  • jcp : pointer to the Jabber connections pool structure
  • id : id of the Jabber connection return : 0 on success or <0 on error

Definition at line 205 of file xjab_util.c.

References _xj_jkey::hash, _xj_jkey::id, _xj_jcon::jkey, _str::len, len, LM_DBG, NULL, _xj_jcon_pool::ojc, _str::s, and xj_jcon_free().

int xj_jcon_pool_del_jmsg ( xj_jcon_pool  jcp,
int  idx 
)

delete first element from messages queue

  • jcp : pointer to the Jabber connections pool structure return : 0 on success or <0 on error

Definition at line 131 of file xjab_util.c.

References _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, NULL, _xj_jmsg_queue::ojc, and _xj_jmsg_queue::size.

Referenced by xj_worker_check_qmsg().

xj_jcon xj_jcon_pool_get ( xj_jcon_pool  jcp,
xj_jkey  jkey 
)

get the jabber connection associated with 'id'

  • jcp : pointer to the Jabber connections pool structure
  • id : id of the Jabber connection return : pointer to the open connection to Jabber structure or NULL on error

Definition at line 173 of file xjab_util.c.

References _xj_jkey::hash, _xj_jkey::id, _xj_jcon::jkey, len, _str::len, LM_DBG, NULL, _xj_jcon_pool::ojc, and _str::s.

Referenced by xj_worker_process().

xj_jcon_pool xj_jcon_pool_init ( int  size,
int  jlen,
int  ch 
)

init a jc_pool structure

  • size : maximum number of the open connection to Jabber
  • jlen : maximum size of messages queue return : pointer to the structure or NULL on error

Definition at line 48 of file xjab_util.c.

References _M_FREE, _M_MALLOC, _xj_jmsg_queue::cache, _xj_jmsg_queue::expire, _xj_jcon_pool::jmqueue, _xj_jmsg_queue::jsm, _xj_jmsg_queue::len, _xj_jcon_pool::len, NULL, _xj_jmsg_queue::ojc, _xj_jcon_pool::ojc, and _xj_jmsg_queue::size.

Referenced by xj_worker_process().

void xj_jcon_pool_print ( xj_jcon_pool   ) 


Generated on Fri May 25 00:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6