[zeromq-dev] Only receive a single published message per connection?

Michael Small michaelsmall at me.com
Wed Aug 4 05:33:41 CEST 2010


I've observed strange behaviour in my initial testing of pub/sub.

The relevant subscriber code:

while(s.recv(&msg)) {
            printf("Received: %s\n", (char*)msg.data());
        }

And the publish code:

s.send(msg);
s.send(msg);
getchar();

The first message is received, but the second is not. If I kill the publisher and restart (leaving the subscriber active), again the first message is received, but not the second.
Is there some semantic of this pattern that I'm not aware of?

This is being tested on an OS X 10.6.4 box.

Cheers,
Michael



More information about the zeromq-dev mailing list