[zeromq-dev] What's wrong with this sample?

Rick & Nellie Flower nrf at ca-flower.com
Fri Jan 20 16:37:55 CET 2012


On Jan 20, 2012, at 12:35 AM, Mikko Koppanen wrote:
> 
> it looks like you are using the C++ bindings. If you look at the
> definition of send and recv:
> 
> https://github.com/zeromq/zeromq2-1/blob/master/include/zmq.hpp#L314
> https://github.com/zeromq/zeromq2-1/blob/master/include/zmq.hpp#L324
> 
> They will return true or false or thow error_t based on status. This
> would probably break the following assertion in your code:
> 
> assert(socket.send (request)== 0);
> 
> Changing the socket.send and socket.recv assertions to == true gives
> me the following output on Mac OS X:
> 
> $ ./a.out
> Starting workers..
> Sending Data...
> Sending Data...
> Sending Data...
> Sending Data...
> status = 35
> Received: Ghiasd!
> status = 35
> Received: Ghiasd!
> status = 35
> Received: Ghiasd!
> status = 35
> Received: Ghiasd!

Thanks.. I missed that.. I've got some live code that is very similar to this
on a Solaris 10 server and the first thread to do a send hangs the entire
process since it ends up doing a poll() down in the bowels.. I do not have
a stackdump unfortunately since it's not on wired server (disconnected 
from the Internet)… I'll have to look at it closer to see if there's a disconnect
between it and this sample code.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120120/302a9c7f/attachment.htm>


More information about the zeromq-dev mailing list