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?