[zeromq-dev] publish not flushing

Matt Weinstein matt_weinstein at yahoo.com
Thu Aug 5 12:07:36 CEST 2010


BTW I think ØMQ will only look at the first msg in a series for the pattern. So it's easier to do

   s.send(pattern,ZMQ_SNDMORE)
   s.send(payload)

Rather than constructing a merged packet....



On Aug 5, 2010, at 12:03 AM, Michael Small <michaelsmall at me.com> wrote:

> I have a process which publishes messages like so:
> 
> for(int i = 0; i < 100; ++i) {
> std::size_t topic_sz = topic.size()-1;
> std::size_t obj_sz = sizeof(TestMsg);
> zmq::message_t msg(sz);
> uint8_t* bytes = reinterpret_cast<uint8_t*>(msg.data());
> memcpy(&bytes[0], topic.c_str(), topic_sz); 
> memcpy(&bytes[topic_sz], &t, obj_sz);
> int r = s.send(msg);
> }
> 
> Interestingly it seems as if the first message will be received in the client, but the rest aren't until after the loop exits and the zmq::context_t is destroyed.
> 
> Is there some flag or method to flush the messages that I'm not aware of?
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100805/f0e8676d/attachment.htm>


More information about the zeromq-dev mailing list