mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-11-09 09:03:53 +01:00
Switch analysis socket to NOBLOCK
Since we cannot control the rate of the producer (its whatever the detector is currently doing) we cannot afford to block if no clients are present.
This commit is contained in:
1 parent
6129b711ba
commit
773320799a
1 file changed
+18
-14
@@ -194,21 +194,25 @@ void ZmqLiveSender::send(const ModuleFrameBuffer *meta, const char *data)
|
||||
text_header = buffer.GetString();
|
||||
}
|
||||
|
||||
zmq_send(socket_live_,
|
||||
text_header.c_str(),
|
||||
text_header.size(),
|
||||
ZMQ_SNDMORE | ZMQ_NOBLOCK);
|
||||
// TODO: Ugly. Fix this flow control.
|
||||
if (zmq_send(socket_live_,
|
||||
text_header.c_str(),
|
||||
text_header.size(),
|
||||
ZMQ_SNDMORE | ZMQ_NOBLOCK) != -1) {
|
||||
|
||||
if ( send_live_analysis == 0 ) {
|
||||
zmq_send(socket_live_,
|
||||
(char*)data,
|
||||
buffer_config::MODULE_N_BYTES * config_.n_modules,
|
||||
0);
|
||||
} else {
|
||||
zmq_send(socket_live_,
|
||||
(char*)data_empty,
|
||||
8,
|
||||
0);
|
||||
if ( send_live_analysis == 0 ) {
|
||||
zmq_send(socket_live_,
|
||||
(char*)data,
|
||||
buffer_config::MODULE_N_BYTES * config_.n_modules,
|
||||
ZMQ_NOBLOCK);
|
||||
} else {
|
||||
zmq_send(socket_live_,
|
||||
(char*)data_empty,
|
||||
8,
|
||||
ZMQ_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user