|
|
@ -6,14 +6,14 @@
|
|
|
|
#include <zmq.h>
|
|
|
|
#include <zmq.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
//#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void *context = zmq_init (1);
|
|
|
|
void *context = zmq_init (1);
|
|
|
|
|
|
|
|
|
|
|
|
// Socket to talk to server
|
|
|
|
// Socket to talk to server
|
|
|
|
printf ("Connecting to hello world server…\n");
|
|
|
|
printf ("Connecting to hello world server...\n");
|
|
|
|
void *requester = zmq_socket (context, ZMQ_REQ);
|
|
|
|
void *requester = zmq_socket (context, ZMQ_REQ);
|
|
|
|
zmq_connect (requester, "tcp://localhost:5555");
|
|
|
|
zmq_connect (requester, "tcp://localhost:5555");
|
|
|
|
|
|
|
|
|
|
|
@ -23,7 +23,7 @@ int main (void)
|
|
|
|
zmq_msg_t request;
|
|
|
|
zmq_msg_t request;
|
|
|
|
zmq_msg_init_size (&request, 5);
|
|
|
|
zmq_msg_init_size (&request, 5);
|
|
|
|
memcpy (zmq_msg_data (&request), "Hello", 5);
|
|
|
|
memcpy (zmq_msg_data (&request), "Hello", 5);
|
|
|
|
printf ("Sending Hello %d…\n", request_nbr);
|
|
|
|
printf ("Sending Hello %d...\n", request_nbr);
|
|
|
|
zmq_send (requester, &request, 0);
|
|
|
|
zmq_send (requester, &request, 0);
|
|
|
|
zmq_msg_close (&request);
|
|
|
|
zmq_msg_close (&request);
|
|
|
|
|
|
|
|
|
|
|
|