From d8d98f0f5b84a9cf5122357554d35b15c9c140ab Mon Sep 17 00:00:00 2001 From: Fu Juntang <StrongTiger_001@163.com> Date: 星期日, 26 九月 2021 16:44:13 +0800 Subject: [PATCH] link protobuf library statically. --- src/net/net_mod_socket.cpp | 44 ++++++++++++++++++++++++++++---------------- 1 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/net/net_mod_socket.cpp b/src/net/net_mod_socket.cpp index ab065eb..b3aa9b0 100644 --- a/src/net/net_mod_socket.cpp +++ b/src/net/net_mod_socket.cpp @@ -46,13 +46,25 @@ return shmModSocket.force_bind(key); } -int NetModSocket::bind_proc_id(char *buf, int len) { - return shmModSocket.bind_proc_id(buf, len); -} - int NetModSocket::reg(void *pData, int len, void **buf, int *size, const int timeout_ms, int flag) { return shmModSocket.reg(pData, len, buf, size, timeout_ms, flag); +} + +void NetModSocket::int_set(int data) { + int_val = data; +} + +void NetModSocket::svr_set(int data) { + svr_val = data; +} + +int NetModSocket::int_get(void) { + return int_val; +} + +int NetModSocket::svr_get(void) { + return svr_val; } // int NetModSocket::sendandrecv(net_node_t *node_arr, int arrlen, void *send_buf, int send_size, @@ -493,20 +505,20 @@ * @key 鍙戦�佺粰璋� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::sendto(const void *buf, const int size, const int key){ - return shmModSocket.sendto(buf, size, key); +int NetModSocket::sendto(const void *buf, const int size, const int key, int reset, int data_set){ + return shmModSocket.sendto(buf, size, key, 0, 0, reset, data_set); } // 鍙戦�佷俊鎭秴鏃惰繑鍥炪�� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::sendto_timeout(const void *buf, const int size, const int key, int sec, int nsec){ +int NetModSocket::sendto_timeout(const void *buf, const int size, const int key, int sec, int nsec, int reset, int data_set){ struct timespec timeout = {sec, nsec}; - return shmModSocket.sendto(buf, size, key, &timeout, BUS_TIMEOUT_FLAG); + return shmModSocket.sendto(buf, size, key, &timeout, BUS_TIMEOUT_FLAG, reset, data_set); } // 鍙戦�佷俊鎭珛鍒昏繑鍥炪�� -int NetModSocket::sendto_nowait(const void *buf, const int size, const int key){ - return shmModSocket.sendto(buf, size, key, NULL, BUS_NOWAIT_FLAG); +int NetModSocket::sendto_nowait(const void *buf, const int size, const int key, int reset, int data_set){ + return shmModSocket.sendto(buf, size, key, NULL, BUS_NOWAIT_FLAG, reset, data_set); } @@ -515,21 +527,21 @@ * @key 浠庤皝鍝噷鏀跺埌鐨勪俊鎭� * @return 0 鎴愬姛锛� 鍏朵粬鍊� 澶辫触鐨勯敊璇爜 */ -int NetModSocket::recvfrom(void **buf, int *size, int *key) { +int NetModSocket::recvfrom(void **buf, int *size, int *key, int reset, int data_set) { - return shmModSocket.recvfrom(buf, size, key); + return shmModSocket.recvfrom(buf, size, key, 0, 0, reset, data_set); } // 鎺ュ彈淇℃伅瓒呮椂杩斿洖銆� @sec 绉� 锛� @nsec 绾崇 -int NetModSocket::recvfrom_timeout(void **buf, int *size, int *key, int sec, int nsec){ +int NetModSocket::recvfrom_timeout(void **buf, int *size, int *key, int sec, int nsec, int reset, int data_set){ struct timespec timeout = {sec, nsec}; - return shmModSocket.recvfrom(buf, size, key, &timeout, BUS_TIMEOUT_FLAG); + return shmModSocket.recvfrom(buf, size, key, &timeout, BUS_TIMEOUT_FLAG, reset, data_set); } -int NetModSocket::recvfrom_nowait(void **buf, int *size, int *key){ - return shmModSocket.recvfrom(buf, size, key, NULL, BUS_NOWAIT_FLAG); +int NetModSocket::recvfrom_nowait(void **buf, int *size, int *key, int reset, int data_set){ + return shmModSocket.recvfrom(buf, size, key, NULL, BUS_NOWAIT_FLAG, reset, data_set); } int NetModSocket::recvandsend(recvandsend_callback_fn callback, -- Gitblit v1.8.0