CUBRID Engine  latest
connection_support.h File Reference
#include "connection_defs.h"
#include <sys/poll.h>
Include dependency graph for connection_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct pollfd POLL_FD
 
typedef void(* CSS_SERVER_TIMEOUT_FN) (void)
 
typedef bool(* CSS_CHECK_SERVER_ALIVE_FN) (const char *, const char *)
 

Functions

int css_readn (SOCKET fd, char *ptr, int nbytes, int timeout)
 
void css_read_remaining_bytes (SOCKET fd, int len)
 
int css_net_recv (SOCKET fd, char *buffer, int *maxlen, int timeout)
 
int css_net_send (CSS_CONN_ENTRY *conn, const char *buff, int len, int timeout)
 
int css_net_send_buffer_only (CSS_CONN_ENTRY *conn, const char *buff, int len, int timeout)
 
int css_net_read_header (SOCKET fd, char *buffer, int *maxlen, int timeout)
 
int css_send_request_with_data_buffer (CSS_CONN_ENTRY *conn, int request, unsigned short *rid, const char *arg_buffer, int arg_buffer_size, char *data_buffer, int data_buffer_size)
 
int css_send_request (CSS_CONN_ENTRY *conn, int request, unsigned short *rid, const char *arg_buffer, int arg_buffer_size)
 
int css_send_data (CSS_CONN_ENTRY *conn, unsigned short rid, const char *buffer, int buffer_size)
 
int css_send_error (CSS_CONN_ENTRY *conn, unsigned short rid, const char *buffer, int buffer_size)
 
const char * css_ha_server_state_string (HA_SERVER_STATE state)
 
const char * css_ha_applier_state_string (HA_LOG_APPLIER_STATE state)
 
const char * css_ha_mode_string (HA_MODE mode)
 
void css_register_server_timeout_fn (CSS_SERVER_TIMEOUT_FN callback_fn)
 
void css_register_check_server_alive_fn (CSS_CHECK_SERVER_ALIVE_FN callback_fn)
 
int css_send_magic (CSS_CONN_ENTRY *conn)
 
int css_check_magic (CSS_CONN_ENTRY *conn)
 
int css_check_magic_with_socket (SOCKET fd)
 
int css_user_access_status_start_scan (THREAD_ENTRY *thread_p, int type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 
int css_platform_independent_poll (POLL_FD *fds, int num_of_fds, int timeout)
 
int css_vector_send (SOCKET fd, struct iovec *vec[], int *len, int bytes_written, int timeout)
 
void css_set_net_header (NET_HEADER *header_p, int type, short function_code, int request_id, int buffer_size, int transaction_id, int invalidate_snapshot, int db_error)
 
void css_set_io_vector (struct iovec *vec1_p, struct iovec *vec2_p, const char *buff, int len, int *templen)
 
int css_send_io_vector_with_socket (SOCKET &socket, struct iovec *vec_p, ssize_t total_len, int vector_length, int timeout)
 
int css_send_magic_with_socket (SOCKET &socket)
 
int css_net_send_with_socket (SOCKET &socket, const char *buff, int len, int timeout)
 
int css_net_send3_with_socket (SOCKET &socket, const char *buff1, int len1, const char *buff2, int len2, const char *buff3, int len3)
 
int css_send_request_with_socket (SOCKET &socket, int command, unsigned short *request_id, const char *arg_buffer, int arg_buffer_size)
 

Variables

CSS_CHECK_SERVER_ALIVE_FN css_check_server_alive_fn
 

Typedef Documentation

typedef bool(* CSS_CHECK_SERVER_ALIVE_FN) (const char *, const char *)

Definition at line 51 of file connection_support.h.

typedef void(* CSS_SERVER_TIMEOUT_FN) (void)

Definition at line 49 of file connection_support.h.

typedef struct pollfd POLL_FD

Definition at line 42 of file connection_support.h.

Function Documentation

int css_check_magic ( CSS_CONN_ENTRY conn)

Definition at line 2483 of file connection_support.c.

References css_check_magic_with_socket(), and css_conn_entry::fd.

Referenced by css_process_new_connection().

Here is the caller graph for this function:

int css_check_magic_with_socket ( SOCKET  fd)

Definition at line 2489 of file connection_support.c.

References css_Net_magic, css_readn(), ERROR_ON_READ, ERROR_WHEN_READING_SIZE, i, NO_ERRORS, ntohl(), p, prm_get_integer_value(), PRM_ID_TCP_CONNECTION_TIMEOUT, and WRONG_PACKET_TYPE.

Referenced by css_check_magic().

Here is the caller graph for this function:

const char* css_ha_mode_string ( HA_MODE  mode)
int css_net_read_header ( SOCKET  fd,
char *  buffer,
int *  maxlen,
int  timeout 
)

Definition at line 1472 of file connection_support.c.

References css_net_recv().

Referenced by css_read_header(), css_receive_data(), and css_receive_error().

Here is the caller graph for this function:

int css_net_send ( CSS_CONN_ENTRY conn,
const char *  buff,
int  len,
int  timeout 
)

Definition at line 1062 of file connection_support.c.

References css_net_send_with_socket(), and css_conn_entry::fd.

Referenced by css_abort_request(), css_connect_to_master_server(), css_send_close_request(), and css_send_request_with_data_buffer().

Here is the caller graph for this function:

int css_net_send3_with_socket ( SOCKET socket,
const char *  buff1,
int  len1,
const char *  buff2,
int  len2,
const char *  buff3,
int  len3 
)

Definition at line 1130 of file connection_support.c.

References css_send_io_vector_with_socket(), and css_set_io_vector().

Referenced by css_net_send3(), and css_send_request_with_socket().

Here is the caller graph for this function:

int css_net_send_buffer_only ( CSS_CONN_ENTRY conn,
const char *  buff,
int  len,
int  timeout 
)

Definition at line 1453 of file connection_support.c.

References css_send_io_vector().

int css_net_send_with_socket ( SOCKET socket,
const char *  buff,
int  len,
int  timeout 
)

Definition at line 1068 of file connection_support.c.

References css_send_io_vector_with_socket(), and css_set_io_vector().

Referenced by css_net_send(), css_send_magic_with_socket(), and css_send_request_with_socket().

Here is the caller graph for this function:

int css_platform_independent_poll ( POLL_FD fds,
int  num_of_fds,
int  timeout 
)

Definition at line 2891 of file connection_support.c.

References assert, LOG_SYSTEM_TRAN_INDEX, NULL_TRAN_INDEX, rc, and css_conn_entry::transaction_id.

Referenced by hb_process_master_request().

Here is the caller graph for this function:

void css_read_remaining_bytes ( SOCKET  fd,
int  len 
)

Definition at line 489 of file connection_support.c.

References css_readn(), and CSS_TRUNCATE_BUFFER_SIZE.

Referenced by css_net_recv(), css_queue_data_packet(), css_queue_error_packet(), css_receive_data(), and css_receive_error().

Here is the caller graph for this function:

void css_register_check_server_alive_fn ( CSS_CHECK_SERVER_ALIVE_FN  callback_fn)

Definition at line 2131 of file connection_support.c.

References css_check_server_alive_fn.

Referenced by cas_init().

Here is the caller graph for this function:

int css_send_data ( CSS_CONN_ENTRY conn,
unsigned short  rid,
const char *  buffer,
int  buffer_size 
)
int css_send_io_vector_with_socket ( SOCKET socket,
struct iovec *  vec_p,
ssize_t  total_len,
int  vector_length,
int  timeout 
)

Definition at line 1027 of file connection_support.c.

References css_shutdown_socket(), css_vector_send(), ERROR_ON_WRITE, INVALID_SOCKET, IS_INVALID_SOCKET, NO_ERRORS, and rc.

Referenced by css_net_send3_with_socket(), css_net_send_with_socket(), and css_send_io_vector().

Here is the caller graph for this function:

int css_send_magic ( CSS_CONN_ENTRY conn)

Definition at line 2460 of file connection_support.c.

References css_send_magic_with_socket(), and css_conn_entry::fd.

Referenced by css_common_connect().

Here is the caller graph for this function:

int css_send_magic_with_socket ( SOCKET socket)

Definition at line 2466 of file connection_support.c.

References css_Net_magic, and css_net_send_with_socket().

Referenced by css_send_magic().

Here is the caller graph for this function:

int css_send_request ( CSS_CONN_ENTRY conn,
int  request,
unsigned short *  rid,
const char *  arg_buffer,
int  arg_buffer_size 
)
int css_send_request_with_data_buffer ( CSS_CONN_ENTRY conn,
int  request,
unsigned short *  rid,
const char *  arg_buffer,
int  arg_buffer_size,
char *  data_buffer,
int  data_buffer_size 
)
int css_send_request_with_socket ( SOCKET socket,
int  command,
unsigned short *  request_id,
const char *  arg_buffer,
int  arg_buffer_size 
)
void css_set_io_vector ( struct iovec *  vec1_p,
struct iovec *  vec2_p,
const char *  buff,
int  len,
int *  templen 
)

Definition at line 994 of file connection_support.c.

References htonl().

Referenced by css_net_send2(), css_net_send3_with_socket(), css_net_send4(), css_net_send6(), css_net_send8(), and css_net_send_with_socket().

Here is the caller graph for this function:

void css_set_net_header ( NET_HEADER header_p,
int  type,
short  function_code,
int  request_id,
int  buffer_size,
int  transaction_id,
int  invalidate_snapshot,
int  db_error 
)
int css_vector_send ( SOCKET  fd,
struct iovec *  vec[],
int *  len,
int  bytes_written,
int  timeout 
)

Definition at line 893 of file connection_support.c.

References ARG_FILE_LINE, css_set_networking_error(), er_log_debug, and i.

Referenced by css_net_recv(), and css_send_io_vector_with_socket().

Here is the caller graph for this function:

Variable Documentation