Created
April 14, 2011 19:48
-
-
Save SavageMessiah/920327 to your computer and use it in GitHub Desktop.
ctrl-c test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <zmq.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
int main (void) | |
{ | |
void *context = zmq_init (1); | |
// Socket to talk to clients | |
void *responder = zmq_socket (context, ZMQ_REP); | |
zmq_bind (responder, "tcp://*:5555"); | |
while (1) { | |
// Wait for next request from client | |
zmq_msg_t request; | |
zmq_msg_init (&request); | |
zmq_recv (responder, &request, 0); | |
printf ("Received Hello\n"); | |
zmq_msg_close (&request); | |
} | |
// We never get here but if we did, this would be how we end | |
zmq_close (responder); | |
zmq_term (context); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment