11 int main (
int argc,
char* argv[]) {
13 zmq::context_t context (1);
14 zmq::socket_t socket (context, ZMQ_REQ);
16 std::cout <<
"Connecting to hello world server…" << std::endl;
17 socket.connect (
"tcp://localhost:5555");
20 for (
int request_nbr = 0; request_nbr != 10; request_nbr++) {
21 zmq::message_t request (6);
22 memcpy ((
void *) request.data (),
"Hello", 5);
23 std::cout <<
"Sending Hello " << request_nbr <<
"…" << std::endl;
24 socket.send (request);
29 std::cout <<
"Received World " << request_nbr << std::endl;