[zeromq-dev] publish not flushing

Michael Small michaelsmall at me.com
Thu Aug 5 06:06:59 CEST 2010


I should add that r == 1 in all cases.

On 05/08/2010, at 2:03 PM, Michael Small 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/2115bb0e/attachment.htm>


More information about the zeromq-dev mailing list