| | |
| | | private: |
| | | |
| | | ShmModSocket shmModSocket; |
| | | |
| | | int int_val; |
| | | int svr_val; |
| | | // pthread_mutex_t sendMutex; |
| | | |
| | | // request header 编码为网络传输的字节 |
| | |
| | | net_mod_recv_msg_t ** recv_arr, int *recv_arr_size, |
| | | net_mod_err_t ** _err_arr, int *_err_arr_size, int timeout); |
| | | |
| | | |
| | | void int_set(int data); |
| | | void svr_set(int data); |
| | | int int_get(void); |
| | | int svr_get(void); |
| | | /** |
| | | * 功能同sendandrecv |
| | | * 优点:线程安全 |
| | |
| | | // int sendandrecv_safe(net_node_t *node_arr, int node_arr_len, void *send_buf, int send_size, |
| | | // net_mod_recv_msg_t ** recv_arr, int *recv_arr_size); |
| | | |
| | | |
| | | /** |
| | | * 发送信息 |
| | | * @key 发送给谁 |
| | | * @return 0 成功, 其他值 失败的错误码 |
| | | */ |
| | | int sendto( const void *buf, const int size, const int key); |
| | | int sendto( const void *buf, const int size, const int key, int reset = 0, int data_set = 0); |
| | | // 发送信息超时返回。 @sec 秒 , @nsec 纳秒 |
| | | int sendto_timeout( const void *buf, const int size, const int key, int sec, int nsec); |
| | | int sendto_timeout( const void *buf, const int size, const int key, int sec, int nsec, int reset = 0, int data_set = 0); |
| | | // 发送信息立刻返回。 |
| | | int sendto_nowait( const void *buf, const int size, const int key); |
| | | int sendto_nowait( const void *buf, const int size, const int key, int reset = 0, int data_set = 0); |
| | | |
| | | /** |
| | | * 接收信息 |
| | | * @key 从谁哪里收到的信息 |
| | | * @return 0 成功, 其他值 失败的错误码 |
| | | */ |
| | | int recvfrom( void **buf, int *size, int *key); |
| | | int recvfrom( void **buf, int *size, int *key, int reset = 0, int data_set = 0); |
| | | // 接受信息超时返回。 @sec 秒 , @nsec 纳秒 |
| | | int recvfrom_timeout( void **buf, int *size, int *key, int sec, int nsec); |
| | | int recvfrom_nowait( void **buf, int *size, int *key); |
| | | int recvfrom_timeout( void **buf, int *size, int *key, int sec, int nsec, int reset = 0, int data_set = 0); |
| | | int recvfrom_nowait( void **buf, int *size, int *key, int reset = 0, int data_set = 0); |
| | | |
| | | /** |
| | | * 本地发送请求信息并等待接收应答 |
| | | * @key 发送给谁 |