// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
#include <iostream>
#include <string>

using namespace std;

#include <zmq.hpp>

using namespace zmq;

int main(void)
{
    context_t ctx;
    socket_t s(ctx, socket_type::pull);
    s.bind("tcp://*:10003");
    for(;;)
    {
        message_t temp;
        s.recv(temp, recv_flags::none);
        string reqmsg = temp.to_string();
        cout << "C++ server : " << reqmsg << endl;
    }
    return 0;
}
