CUBRID Engine
latest
|
Go to the source code of this file.
Classes | |
struct | MSG_HEADER |
Macros | |
#define | NET_MIN_TIMEOUT 2 |
#define | NET_DEFAULT_TIMEOUT 60 |
#define | MYSQL_CONNECT_TIMEOUT (5*60*60) /* 5 hour. MySQL timeout = 8 hour */ |
#define | NET_SIZE_BYTE ((int) sizeof(char)) |
#define | NET_SIZE_SHORT ((int) sizeof(short)) |
#define | NET_SIZE_INT ((int) sizeof(int)) |
#define | NET_SIZE_FLOAT ((int) sizeof(float)) |
#define | NET_SIZE_DOUBLE ((int) sizeof(double)) |
#define | NET_SIZE_INT64 ((int) sizeof(INT64)) |
#define | NET_SIZE_BIGINT NET_SIZE_INT64 |
#define | NET_SIZE_DATE (NET_SIZE_SHORT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
#define | NET_SIZE_TIME (NET_SIZE_SHORT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
#define | NET_SIZE_OBJECT (NET_SIZE_INT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
#define | NET_SIZE_TIMESTAMP (NET_SIZE_SHORT * 6) |
#define | NET_SIZE_DATETIME (NET_SIZE_SHORT * 7) |
#define | NET_ARG_GET_SIZE(SIZE, ARG) |
#define | NET_ARG_GET_BIGINT(VALUE, ARG) |
#define | NET_ARG_GET_INT(VALUE, ARG) |
#define | NET_ARG_GET_SHORT(VALUE, ARG) |
#define | NET_ARG_GET_FLOAT(VALUE, ARG) |
#define | NET_ARG_GET_DOUBLE(VALUE, ARG) |
#define | NET_ARG_GET_CHAR(VALUE, ARG) |
#define | NET_ARG_GET_STR(VALUE, SIZE, ARG) |
#define | NET_ARG_GET_DATE(YEAR, MON, DAY, ARG) |
#define | NET_ARG_GET_TIME(HH, MM, SS, ARG) |
#define | NET_ARG_GET_TIMESTAMP(YR, MON, DAY, HH, MM, SS, ARG) |
#define | NET_ARG_GET_DATETIME(YR, MON, DAY, HH, MM, SS, MS, ARG) |
#define | NET_ARG_GET_OBJECT(VALUE, ARG) |
#define | NET_ARG_GET_CCI_OBJECT(PAGEID, SLOTID, VOLID, ARG) |
#define | NET_ARG_GET_CACHE_TIME(CT, ARG) |
Functions | |
SOCKET | net_init_env (char *port_name) |
SOCKET | net_connect_proxy (void) |
SOCKET | net_connect_client (SOCKET srv_sock_fd) |
int | net_read_stream (SOCKET sock_fd, char *buf, int size) |
int | net_write_stream (SOCKET sock_fd, const char *buf, int size) |
int | net_write_int (SOCKET sock_fd, int value) |
int | net_read_int (SOCKET sock_fd, int *value) |
int | net_decode_str (char *msg, int msg_size, char *func_code, void ***ret_argv) |
int | net_read_to_file (SOCKET sock_fd, int file_size, char *filename) |
int | net_write_from_file (SOCKET sock_fd, int file_size, char *filename) |
void | net_timeout_set (int timeout_sec) |
void | init_msg_header (MSG_HEADER *header) |
int | net_read_header (SOCKET sock_fd, MSG_HEADER *header) |
int | net_write_header (SOCKET sock_fd, MSG_HEADER *header) |
bool | is_net_timed_out (void) |
void | net_write_error (SOCKET sock, int version, char *driver_info, char *cas_info, int cas_info_size, int indicator, int code, char *msg) |
#define MYSQL_CONNECT_TIMEOUT (5*60*60) /* 5 hour. MySQL timeout = 8 hour */ |
Definition at line 35 of file cas_network.h.
#define NET_ARG_GET_BIGINT | ( | VALUE, | |
ARG | |||
) |
Definition at line 70 of file cas_network.h.
#define NET_ARG_GET_CACHE_TIME | ( | CT, | |
ARG | |||
) |
Definition at line 248 of file cas_network.h.
Definition at line 232 of file cas_network.h.
#define NET_ARG_GET_CHAR | ( | VALUE, | |
ARG | |||
) |
Definition at line 106 of file cas_network.h.
Definition at line 127 of file cas_network.h.
#define NET_ARG_GET_DATETIME | ( | YR, | |
MON, | |||
DAY, | |||
HH, | |||
MM, | |||
SS, | |||
MS, | |||
ARG | |||
) |
Definition at line 181 of file cas_network.h.
#define NET_ARG_GET_DOUBLE | ( | VALUE, | |
ARG | |||
) |
Definition at line 99 of file cas_network.h.
#define NET_ARG_GET_FLOAT | ( | VALUE, | |
ARG | |||
) |
Definition at line 92 of file cas_network.h.
#define NET_ARG_GET_INT | ( | VALUE, | |
ARG | |||
) |
Definition at line 78 of file cas_network.h.
#define NET_ARG_GET_OBJECT | ( | VALUE, | |
ARG | |||
) |
Definition at line 208 of file cas_network.h.
#define NET_ARG_GET_SHORT | ( | VALUE, | |
ARG | |||
) |
Definition at line 85 of file cas_network.h.
#define NET_ARG_GET_SIZE | ( | SIZE, | |
ARG | |||
) |
Definition at line 54 of file cas_network.h.
#define NET_ARG_GET_STR | ( | VALUE, | |
SIZE, | |||
ARG | |||
) |
Definition at line 111 of file cas_network.h.
#define NET_ARG_GET_TIME | ( | HH, | |
MM, | |||
SS, | |||
ARG | |||
) |
Definition at line 142 of file cas_network.h.
#define NET_ARG_GET_TIMESTAMP | ( | YR, | |
MON, | |||
DAY, | |||
HH, | |||
MM, | |||
SS, | |||
ARG | |||
) |
Definition at line 157 of file cas_network.h.
#define NET_DEFAULT_TIMEOUT 60 |
Definition at line 34 of file cas_network.h.
Referenced by cas_main(), process_request(), and shard_cas_main().
#define NET_MIN_TIMEOUT 2 |
Definition at line 33 of file cas_network.h.
Referenced by cas_main().
#define NET_SIZE_BIGINT NET_SIZE_INT64 |
Definition at line 47 of file cas_network.h.
Referenced by add_res_data_bigint(), net_arg_get_bigint(), net_arg_get_size(), and net_buf_cp_bigint().
#define NET_SIZE_BYTE ((int) sizeof(char)) |
Definition at line 41 of file cas_network.h.
Referenced by add_res_data_string(), net_buf_cp_byte(), net_buf_cp_cas_type_and_charset(), and proxy_io_make_end_tran_request().
#define NET_SIZE_DATE (NET_SIZE_SHORT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
Definition at line 48 of file cas_network.h.
Referenced by add_res_data_date().
#define NET_SIZE_DATETIME (NET_SIZE_SHORT * 7) |
Definition at line 52 of file cas_network.h.
Referenced by add_res_data_datetime(), add_res_data_datetimetz(), and net_arg_get_datetimetz().
#define NET_SIZE_DOUBLE ((int) sizeof(double)) |
Definition at line 45 of file cas_network.h.
Referenced by add_res_data_double(), net_arg_get_double(), and net_buf_cp_double().
#define NET_SIZE_FLOAT ((int) sizeof(float)) |
Definition at line 44 of file cas_network.h.
Referenced by add_res_data_float(), net_arg_get_float(), and net_buf_cp_float().
#define NET_SIZE_INT ((int) sizeof(int)) |
Definition at line 43 of file cas_network.h.
Referenced by add_res_data_bigint(), add_res_data_bytes(), add_res_data_date(), add_res_data_datetime(), add_res_data_datetimetz(), add_res_data_double(), add_res_data_float(), add_res_data_int(), add_res_data_lob_handle(), add_res_data_object(), add_res_data_short(), add_res_data_string(), add_res_data_time(), add_res_data_timestamp(), add_res_data_timestamptz(), dbval_to_net_buf(), fn_proxy_cas_prepare(), fn_proxy_cas_prepare_and_execute(), fn_proxy_cas_schema_info(), net_arg_get_bigint(), net_arg_get_cache_time(), net_arg_get_cci_object(), net_arg_get_date(), net_arg_get_datetime(), net_arg_get_datetimetz(), net_arg_get_double(), net_arg_get_float(), net_arg_get_int(), net_arg_get_lob_handle(), net_arg_get_object(), net_arg_get_short(), net_arg_get_size(), net_arg_get_str(), net_arg_get_time(), net_arg_get_timestamp(), net_arg_get_timestamptz(), net_arg_put_int(), net_buf_cp_int(), net_buf_cp_lob_handle(), net_buf_overwrite_int(), net_write_error(), netval_to_dbval(), proxy_has_different_column_info(), shard_stmt_save_prepare_request(), ux_lob_new(), and ux_lob_read().
#define NET_SIZE_INT64 ((int) sizeof(INT64)) |
Definition at line 46 of file cas_network.h.
Referenced by add_res_data_lob_handle(), net_arg_get_lob_handle(), net_buf_cp_lob_handle(), and ux_lob_new().
#define NET_SIZE_OBJECT (NET_SIZE_INT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
Definition at line 50 of file cas_network.h.
Referenced by add_res_data_object(), and net_buf_cp_object().
#define NET_SIZE_SHORT ((int) sizeof(short)) |
Definition at line 42 of file cas_network.h.
Referenced by add_res_data_short(), net_arg_get_cci_object(), net_arg_get_date(), net_arg_get_datetime(), net_arg_get_object(), net_arg_get_short(), net_arg_get_time(), net_arg_get_timestamp(), net_arg_get_timestamptz(), net_buf_cp_cas_type_and_charset(), and net_buf_cp_short().
#define NET_SIZE_TIME (NET_SIZE_SHORT + NET_SIZE_SHORT + NET_SIZE_SHORT) |
Definition at line 49 of file cas_network.h.
Referenced by add_res_data_time().
#define NET_SIZE_TIMESTAMP (NET_SIZE_SHORT * 6) |
Definition at line 51 of file cas_network.h.
Referenced by add_res_data_timestamp(), add_res_data_timestamptz(), and net_arg_get_timestamptz().
void init_msg_header | ( | MSG_HEADER * | header | ) |
Definition at line 358 of file cas_network.c.
References MSG_HEADER::buf, CAS_INFO_ADDITIONAL_FLAG, CAS_INFO_FLAG_MASK_NEW_SESSION_ID, CAS_INFO_RESERVED_1, CAS_INFO_RESERVED_2, CAS_INFO_RESERVED_DEFAULT, CAS_INFO_STATUS, CAS_INFO_STATUS_INACTIVE, MSG_HEADER::info_ptr, MSG_HEADER::msg_body_size_ptr, and MSG_HEADER_MSG_SIZE.
Referenced by cas_register_to_proxy(), process_request(), and proxy_init_net_buf().
bool is_net_timed_out | ( | void | ) |
Definition at line 699 of file cas_network.c.
References net_timeout_flag.
Referenced by net_read_header_keep_con_on(), net_read_int_keep_con_auto(), net_read_process(), net_read_stream(), and process_request().
Definition at line 260 of file cas_network.c.
References INVALID_SOCKET, IS_INVALID_SOCKET, and net_error_flag.
Referenced by cas_main().
SOCKET net_connect_proxy | ( | void | ) |
Definition at line 172 of file cas_network.c.
References as_info, t_shm_appl_server::broker_name, BROKER_PATH_MAX, broker_port, CLOSE_SOCKET, get_host_ip(), htons(), INVALID_SOCKET, IS_INVALID_SOCKET, net_error_flag, NULL, PORT_NUMBER_ENV_STR, t_appl_server_info::proxy_id, SHARD_ERR, shm_appl, strlen, strncpy_bufsize, ut_get_proxy_port_name(), and wsa_initialize().
Referenced by net_init_env(), and shard_cas_main().
int net_decode_str | ( | char * | msg, |
int | msg_size, | ||
char * | func_code, | ||
void *** | ret_argv | ||
) |
Definition at line 393 of file cas_network.c.
References argc, argv, CAS_ER_COMMUNICATION, CAS_ER_NO_MORE_MEMORY, FREE_MEM, ntohl(), NULL, and REALLOC.
Referenced by process_request(), and proxy_handler_process_client_request().
SOCKET net_init_env | ( | char * | port_name | ) |
Definition at line 90 of file cas_network.c.
References CLOSE_SOCKET, htons(), INVALID_SOCKET, IS_INVALID_SOCKET, net_connect_proxy(), ntohs(), proxy_id, sock_addr_len, sock_fd, strlen, and wsa_initialize().
Referenced by cas_main().
int net_read_header | ( | SOCKET | sock_fd, |
MSG_HEADER * | header | ||
) |
Definition at line 329 of file cas_network.c.
References MSG_HEADER::buf, cas_info_size, MSG_HEADER::msg_body_size_ptr, MSG_HEADER_SIZE, net_read_stream(), and ntohl().
Referenced by net_read_header_keep_con_on(), net_read_int_keep_con_auto(), net_read_process(), and process_request().
int net_read_int | ( | SOCKET | sock_fd, |
int * | value | ||
) |
Definition at line 383 of file cas_network.c.
References net_read_stream(), and ntohl().
Referenced by cas_main().
int net_read_stream | ( | SOCKET | sock_fd, |
char * | buf, | ||
int | size | ||
) |
Definition at line 305 of file cas_network.c.
References is_net_timed_out(), and read_buffer().
Referenced by cas_main(), net_read_header(), net_read_int(), and process_request().
int net_read_to_file | ( | SOCKET | sock_fd, |
int | file_size, | ||
char * | filename | ||
) |
Definition at line 446 of file cas_network.c.
References CAS_ER_COMMUNICATION, CAS_ER_OPEN_FILE, CAS_ERROR_INDICATOR, ERROR_INFO_SET, and read_buffer().
void net_timeout_set | ( | int | timeout_sec | ) |
Definition at line 519 of file cas_network.c.
References net_timeout, and new_req_sock_fd.
Referenced by cas_main(), net_read_header_keep_con_on(), net_read_int_keep_con_auto(), net_read_process(), process_request(), and shard_cas_main().
void net_write_error | ( | SOCKET | sock, |
int | version, | ||
char * | driver_info, | ||
char * | cas_info, | ||
int | cas_info_size, | ||
int | indicator, | ||
int | code, | ||
char * | msg | ||
) |
Definition at line 717 of file cas_network.c.
References assert, CAS_CONV_ERROR_TO_OLD, cas_di_understand_renewed_error_code(), CAS_ER_NOT_AUTHORIZED_CLIENT, CAS_ERROR_INDICATOR, CAS_MAKE_VER, DOES_CLIENT_MATCH_THE_PROTOCOL, ERR_MSG_LENGTH, net_error_append_shard_info(), NET_SIZE_INT, net_write_int(), net_write_stream(), NO_ERROR, and PROTOCOL_V2.
Referenced by cas_main(), and process_request().
int net_write_from_file | ( | SOCKET | sock_fd, |
int | file_size, | ||
char * | filename | ||
) |
Definition at line 482 of file cas_network.c.
References net_write_stream().
Referenced by process_request().
int net_write_header | ( | SOCKET | sock_fd, |
MSG_HEADER * | header | ||
) |
Definition at line 347 of file cas_network.c.
References MSG_HEADER::buf, htonl(), MSG_HEADER::msg_body_size_ptr, MSG_HEADER_SIZE, and net_write_stream().
Referenced by cas_register_to_proxy().
int net_write_int | ( | SOCKET | sock_fd, |
int | value | ||
) |
Definition at line 375 of file cas_network.c.
References htonl(), and write_buffer().
Referenced by cas_main(), cas_register_to_proxy(), and net_write_error().
Definition at line 283 of file cas_network.c.
References write_buffer().
Referenced by cas_main(), cas_register_to_proxy(), cas_send_connect_reply_to_driver(), net_write_error(), net_write_from_file(), net_write_header(), and process_request().