Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void loop(DB *db, void *socket) {
- void *raw = NULL;
- char *res = NULL;
- zmq_msg_t request;
- zmq_msg_t reply;
- size_t len = 0;
- while(!quit) {
- zmq_msg_init(&request);
- zmq_recv(socket, &request, 0);
- <process request>
- zmq_msg_close(&request);
- len = strlen(res) + 1;
- // Send reply back to client
- xsend(socket, len, res, 0);
- free(res);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment