Skip to content

Instantly share code, notes, and snippets.

@Asmod4n
Last active August 29, 2015 14:08
Show Gist options
  • Save Asmod4n/b843dd3754a98b95e52c to your computer and use it in GitHub Desktop.
Save Asmod4n/b843dd3754a98b95e52c to your computer and use it in GitHub Desktop.
#include <czmq.h>
int main(void) {
zsock_t *server = zsock_new_stream ("@tcp://*:8080");
assert (server);
while (!zsys_interrupted) {
zmsg_t *msg = zmsg_recv (server);
if (!msg)
break;
zmsg_print (msg);
zmsg_destroy (&msg);
}
return 0;
}
@Asmod4n
Copy link
Author

Asmod4n commented Oct 25, 2014

output of first request received

D: 14-10-25 20:56:06 [005] 00800041A7
D: 14-10-25 20:56:06 [000] 
D: 14-10-25 20:56:08 [005] 00800041A7
D: 14-10-25 20:56:08 [006] hallo

@hintjens
Copy link

This is normal, STREAM sends a null frame on a new client connection. This is actually an API break over 4.0. We should have made it a socket option, and that is still a possibility before 4.1.x stable.

@Asmod4n
Copy link
Author

Asmod4n commented Oct 25, 2014

Would be a good option to have, so you can initialize objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment