From 75c470bd659a2638e9bfd7d680ea429ed994382c Mon Sep 17 00:00:00 2001 From: Andrej Babic Date: Thu, 23 Apr 2020 10:15:21 +0200 Subject: [PATCH] Adjust hwm size --- sf-buffer/src/sf_replay.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf-buffer/src/sf_replay.cpp b/sf-buffer/src/sf_replay.cpp index e4bc89f..4f05343 100644 --- a/sf-buffer/src/sf_replay.cpp +++ b/sf-buffer/src/sf_replay.cpp @@ -93,7 +93,8 @@ int main (int argc, char *argv[]) { auto ctx = zmq_ctx_new(); auto socket = zmq_socket(ctx, ZMQ_PUSH); - int sndhwm = REPLAY_BLOCK_SIZE; + // The +1 is important so we pre-load the next chunk. + int sndhwm = REPLAY_BLOCK_SIZE + 1; if (zmq_setsockopt(socket, ZMQ_SNDHWM, &sndhwm, sizeof(sndhwm)) != 0) { throw runtime_error(strerror (errno)); };