wangzhengquan
2021-01-27 cffa543dbf014dedc120114e13110a0e3b6e5b57
src/socket/shm_socket.cpp
@@ -553,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,