Skip to content

Commit

Permalink
Merge pull request #2 from paneda/input-buffer-delay-fix
Browse files Browse the repository at this point in the history
Change zmq HWM from 1000 to 1
  • Loading branch information
Landberg authored Oct 18, 2016
2 parents 565fe1b + 60392c3 commit f67a263
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/InputZeroMQReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,13 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata)
// zmq sockets are not thread safe. That's why
// we create it here, and not at object creation.

const int hwm = 1;
const int linger = 0;
try {
subscriber.setsockopt(ZMQ_RCVHWM, &hwm, sizeof(hwm));
subscriber.setsockopt(ZMQ_SNDHWM, &hwm, sizeof(hwm));
subscriber.setsockopt(ZMQ_LINGER, &linger, sizeof(linger));
subscriber.connect(workerdata->uri.c_str());

subscriber.setsockopt(ZMQ_SUBSCRIBE, NULL, 0); // subscribe to all messages

while (running)
Expand Down

0 comments on commit f67a263

Please sign in to comment.