Skip to content

Commit baeaebc

Browse files
committed
Fix usage of zmq_msg_recv and zmq_recvmsg
The zmq_msg_recv() function takes the message, socket, and flags while the zmq_recvmsg() function takes the socket, message. This commit addresses that difference.
1 parent 7c3d374 commit baeaebc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zmq.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ typedef struct {
8888

8989
// Avoid using deprecated message receive function when possible
9090
#if ZMQ_VERSION < ZMQ_MAKE_VERSION(3, 2, 0)
91-
# define zmq_msg_recv zmq_recvmsg
91+
# define zmq_msg_recv(msg, socket, flags) zmq_recvmsg(socket, msg, flags)
9292
#endif
9393

9494

@@ -663,7 +663,7 @@ namespace zmq
663663
while (true) {
664664
zmq_msg_t eventMsg;
665665
zmq_msg_init (&eventMsg);
666-
rc = zmq_msg_recv (s, &eventMsg, 0);
666+
rc = zmq_msg_recv (&eventMsg, s, 0);
667667
if (rc == -1 && zmq_errno() == ETERM)
668668
break;
669669
assert (rc != -1);
@@ -680,7 +680,7 @@ namespace zmq
680680
#ifdef ZMQ_NEW_MONITOR_EVENT_LAYOUT
681681
zmq_msg_t addrMsg;
682682
zmq_msg_init (&addrMsg);
683-
rc = zmq_msg_recv (s, &addrMsg, 0);
683+
rc = zmq_msg_recv (&addrMsg, s, 0);
684684
if (rc == -1 && zmq_errno() == ETERM)
685685
break;
686686
assert (rc != -1);

0 commit comments

Comments
 (0)