Commit 5c156cd2 authored by Jordan Sissel's avatar Jordan Sissel

set hwm

parent 8e281ba0
#define _BSD_SOURCE
#include "emitter.h"
#include <zmq.h>
#include "insist.h"
......@@ -10,13 +11,16 @@ void *emitter(void *arg) {
void *socket = zmq_socket(config->zmq, ZMQ_PULL);
insist(socket != NULL, "zmq_socket() failed: %s", strerror(errno));
int64_t hwm = 1;
zmq_setsockopt(socket, ZMQ_HWM, &hwm, sizeof(hwm));
rc = zmq_bind(socket, config->zmq_endpoint);
insist(rc != -1, "zmq_bind(%s) failed: %s", config->zmq_endpoint,
zmq_strerror(errno));
for (;;) {
zmq_msg_t message;
zmq_msg_init(&message);
rc = zmq_msg_init(&message);
insist(rc == 0, "zmq_msg_init failed");
rc = zmq_recv(socket, &message, 0);
insist(rc == 0, "zmq_recv(%s) failed (returned %d): %s",
config->zmq_endpoint, rc, zmq_strerror(errno));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment