From c813f2bf58edb8b3760f776052a5f708a952ba52 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期四, 28 一月 2021 17:25:59 +0800 Subject: [PATCH] update --- src/socket/shm_socket.cpp | 43 +++++++++++++++++++------------------------ 1 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/socket/shm_socket.cpp b/src/socket/shm_socket.cpp index 25c3930..9a13a85 100644 --- a/src/socket/shm_socket.cpp +++ b/src/socket/shm_socket.cpp @@ -384,9 +384,6 @@ } } -int shm_recvfrom2(shm_socket_t *socket, void **buf, int *size, int *key, const struct timespec *timeout, int flag) { - return 501; -} // 鐭繛鎺ユ柟寮忔帴鍙� int shm_recvfrom(shm_socket_t *sokt, void **buf, int *size, int *key, const struct timespec *timeout, int flag) { @@ -423,9 +420,7 @@ shm_msg_t src; -printf ("====== before ======\n"); rv = sokt->queue->pop(src, timeout, flag); -printf ("====== after ======\n %d", rv); if (rv == 0) { if(buf != NULL) { @@ -558,27 +553,27 @@ } -int shm_sendandrecv_unsafe(shm_socket_t *socket, const void *send_buf, - const int send_size, const int send_key, void **recv_buf, - int *recv_size, const struct timespec *timeout, int flags) { - if (socket->socket_type != SHM_SOCKET_DGRAM) { - logger->error( "shm_socket.shm_sendandrecv_unsafe : Can't invoke shm_sendandrecv method in a %d type socket " - "which is not a SHM_SOCKET_DGRAM socket ", - socket->socket_type); - exit(1); - } - int recv_key; - int rv; +// int shm_sendandrecv_unsafe(shm_socket_t *socket, const void *send_buf, +// const int send_size, const int send_key, void **recv_buf, +// int *recv_size, const struct timespec *timeout, int flags) { +// if (socket->socket_type != SHM_SOCKET_DGRAM) { +// logger->error( "shm_socket.shm_sendandrecv_unsafe : Can't invoke shm_sendandrecv method in a %d type socket " +// "which is not a SHM_SOCKET_DGRAM socket ", +// socket->socket_type); +// exit(1); +// } +// int recv_key; +// int rv; - if ((rv = shm_sendto(socket, send_buf, send_size, send_key, timeout, flags)) == 0) { - rv = shm_recvfrom(socket, recv_buf, recv_size, &recv_key, timeout, flags); - return rv; - } else { - return rv; - } - return -1; -} +// if ((rv = shm_sendto(socket, send_buf, send_size, send_key, timeout, flags)) == 0) { +// rv = shm_recvfrom(socket, recv_buf, recv_size, &recv_key, timeout, flags); +// return rv; +// } else { +// return rv; +// } +// return -1; +// } int shm_sendandrecv(shm_socket_t *socket, const void *send_buf, const int send_size, const int send_key, void **recv_buf, -- Gitblit v1.8.0