Networking Reference
In-Depth Information
printf("Received: %s\n", msg);
zstr_send(socket, "world");
free(msg);
}
zsocket_destroy(context, socket);
zctx_destroy(&context);
return 0;
}
And the following is the client code:
/*
Request - Reply
Handling interrupts.
client.c
*/
#include "czmq.h"
int main (int argc, char const *argv[]) {
zctx_t* context = zctx_new();
void* request = zsocket_new(context, ZMQ_REQ);
printf("Starting client...\n");
zsocket_connect(request, "tcp://localhost:5050");
for(;;) {
zstr_send(request, "hello");
char* reply = zstr_recv(request);
if(!reply) {
break;
}
 
Search MirCeyron ::




Custom Search