CUBRID Engine  latest
broker_proxy_conn.c File Reference
#include <sys/types.h>
#include <assert.h>
#include <sys/time.h>
#include <unistd.h>
#include <pthread.h>
#include "porting.h"
#include "broker_proxy_conn.h"
#include "shard_proxy_common.h"
#include "shard_shm.h"
Include dependency graph for broker_proxy_conn.c:

Go to the source code of this file.

Functions

static void broker_free_all_proxy_conn_ent (void)
 
static T_PROXY_CONN_ENTbroker_find_proxy_conn_by_fd (SOCKET fd)
 
static T_PROXY_CONN_ENTbroker_find_proxy_conn_by_id (int proxy_id)
 
int broker_set_proxy_fds (fd_set *fds)
 
SOCKET broker_get_readable_proxy_conn (fd_set *fds)
 
int broker_add_proxy_conn (SOCKET fd)
 
int broker_delete_proxy_conn_by_fd (SOCKET fd)
 
int broker_delete_proxy_conn_by_proxy_id (int proxy_id)
 
int broker_register_proxy_conn (SOCKET fd, int proxy_id)
 
SOCKET broker_find_available_proxy (T_SHM_PROXY *shm_proxy_p)
 
SOCKET broker_get_proxy_conn_maxfd (SOCKET proxy_sock_fd)
 
int broker_init_proxy_conn (int max_proxy)
 
void broker_destroy_proxy_conn (void)
 

Variables

T_PROXY_CONN broker_Proxy_conn
 
pthread_mutex_t proxy_conn_mutex
 

Function Documentation

int broker_delete_proxy_conn_by_fd ( SOCKET  fd)
int broker_delete_proxy_conn_by_proxy_id ( int  proxy_id)
void broker_destroy_proxy_conn ( void  )
static T_PROXY_CONN_ENT * broker_find_proxy_conn_by_fd ( SOCKET  fd)
static

Definition at line 122 of file broker_proxy_conn.c.

References t_proxy_conn_ent::fd, t_proxy_conn_ent::next, NULL, and t_proxy_conn::proxy_conn_ent.

Referenced by broker_register_proxy_conn().

Here is the caller graph for this function:

static T_PROXY_CONN_ENT * broker_find_proxy_conn_by_id ( int  proxy_id)
static

Definition at line 140 of file broker_proxy_conn.c.

References t_proxy_conn_ent::next, NULL, t_proxy_conn::proxy_conn_ent, and t_proxy_conn_ent::proxy_id.

Referenced by broker_find_available_proxy().

Here is the caller graph for this function:

static void broker_free_all_proxy_conn_ent ( void  )
static

Definition at line 53 of file broker_proxy_conn.c.

References FREE_MEM, t_proxy_conn_ent::next, NULL, and t_proxy_conn::proxy_conn_ent.

Referenced by broker_destroy_proxy_conn().

Here is the caller graph for this function:

SOCKET broker_get_proxy_conn_maxfd ( SOCKET  proxy_sock_fd)
SOCKET broker_get_readable_proxy_conn ( fd_set *  fds)
int broker_init_proxy_conn ( int  max_proxy)

Definition at line 411 of file broker_proxy_conn.c.

References t_proxy_conn::cur_num_proxy, t_proxy_conn::max_num_proxy, NULL, t_proxy_conn::proxy_conn_ent, proxy_conn_mutex, and pthread_mutex_init.

Referenced by main().

Here is the caller graph for this function:

int broker_register_proxy_conn ( SOCKET  fd,
int  proxy_id 
)
int broker_set_proxy_fds ( fd_set *  fds)

Variable Documentation

T_PROXY_CONN broker_Proxy_conn
Initial value:
= {
-1,
0,
}
#define NULL
Definition: freelistheap.h:34

Definition at line 40 of file broker_proxy_conn.c.