Fix goby compilation with ZMQ 3.X and newer (was: zmq_recv seems to have changed api)

Bug #1433591 reported by GauteHope
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Goby
Fix Released
High
toby schneider

Bug Description

on Arch Linux:

rc = zmq_recv (poll_items_[i].socket, &part, 0);

in zeromq_services.cpp:389 fails because of the wrong number of arguments.

it seems that http://api.zeromq.org/3-2:zmq-recv have been replaced by: http://api.zeromq.org/3-2:zmq-msg-recv

old behaviour: http://man.cx/zmq_recv%283%29

diff --git a/src/common/zeromq_service.cpp b/src/common/zeromq_service.cpp
index 0b160d0..497cf6c 100644
--- a/src/common/zeromq_service.cpp
+++ b/src/common/zeromq_service.cpp
@@ -386,7 +386,7 @@ bool goby::common::ZeroMQService::poll(long timeout /* = -1 */)
                 }

                 /* Block until a message is available to be received from socket */
- rc = zmq_recv (poll_items_[i].socket, &part, 0);
+ rc = zmq_msg_recv (&part, poll_items_[i].socket, 0);
                 glog.is(DEBUG3) &&
                     glog << group(glog_in_group())
                          << "Had event for poll item " << i << std::endl ;

Related branches

toby schneider (tes)
summary: - zmq_recv seems to have changed api
+ Fix goby compilation with ZMQ 3.X and newer (was: zmq_recv seems to have
+ changed api)
Revision history for this message
toby schneider (tes) wrote :

Looks like this change occurred between ZMQ 2.X and 3.X. Definitely past time to get Goby compiling correctly with ZMQ 3.X and newer. It appears in Ubuntu the 2.X package is "libzmq-dev" and the 3.X and newer package is "libzmq3-dev".

I changed the title to reflect the underlying problem. I also want to make sure it builds correctly with 2.X still, as well, so this will be a little more work than your patch above.

toby schneider (tes)
Changed in goby:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
toby schneider (tes) wrote :
Changed in goby:
assignee: nobody → toby schneider (tes)
status: Confirmed → In Progress
status: In Progress → Fix Committed
toby schneider (tes)
Changed in goby:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.