mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-18 11:56:46 +02: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:
@@ -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