mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-03 19:30:04 +02:00
zmq: set zmq buffer size also to 0 if hwm >= 25 (#653)
This commit is contained in:
parent
4ee4d66977
commit
8361f2bb96
@ -32,8 +32,9 @@ namespace sls {
|
||||
#define ROIVERBOSITY
|
||||
|
||||
// high water mark for gui
|
||||
#define DEFFAULT_LOW_HWM (25)
|
||||
#define DEFAULT_LOW_HWM_BUFFERSIZE (1024 * 1024) // 1MB
|
||||
#define DEFFAULT_LOW_ZMQ_HWM (25)
|
||||
#define DEFAULT_LOW_ZMQ_HWM_BUFFERSIZE (1024 * 1024) // 1MB
|
||||
#define DEFAULT_ZMQ_BUFFERSIZE (0) // os default
|
||||
|
||||
/** zmq header structure */
|
||||
struct zmqHeader {
|
||||
@ -113,14 +114,14 @@ class ZmqSocket {
|
||||
int GetSendHighWaterMark();
|
||||
|
||||
/** Sets high water mark for outbound messages. Default 1000 (zmqlib). Also
|
||||
* changes send buffer size depending on low hwm. Must rebind. */
|
||||
* changes send buffer size depending on hwm. Must rebind. */
|
||||
void SetSendHighWaterMark(int limit);
|
||||
|
||||
/** Returns high water mark for inbound messages */
|
||||
int GetReceiveHighWaterMark();
|
||||
|
||||
/** Sets high water mark for inbound messages. Default 1000 (zmqlib). Also
|
||||
* changes receiver buffer size depending on low hwm. Must reconnect */
|
||||
* changes receiver buffer size depending on hwm. Must reconnect */
|
||||
void SetReceiveHighWaterMark(int limit);
|
||||
|
||||
/** Gets kernel buffer for outbound messages. Default 0 (os) */
|
||||
|
@ -106,9 +106,12 @@ void ZmqSocket::SetSendHighWaterMark(int limit) {
|
||||
throw ZmqSocketError("Could not set ZMQ_SNDHWM to " +
|
||||
std::to_string(limit));
|
||||
}
|
||||
if (limit < DEFFAULT_LOW_HWM) {
|
||||
SetSendBuffer(DEFAULT_LOW_HWM_BUFFERSIZE);
|
||||
|
||||
int bufsize = DEFAULT_ZMQ_BUFFERSIZE;
|
||||
if (limit < DEFFAULT_LOW_ZMQ_HWM) {
|
||||
bufsize = DEFAULT_LOW_ZMQ_HWM_BUFFERSIZE;
|
||||
}
|
||||
SetSendBuffer(bufsize);
|
||||
}
|
||||
|
||||
int ZmqSocket::GetReceiveHighWaterMark() {
|
||||
@ -132,9 +135,11 @@ void ZmqSocket::SetReceiveHighWaterMark(int limit) {
|
||||
throw ZmqSocketError("Could not set ZMQ_RCVHWM to " +
|
||||
std::to_string(limit));
|
||||
}
|
||||
if (limit < DEFFAULT_LOW_HWM) {
|
||||
SetReceiveBuffer(DEFAULT_LOW_HWM_BUFFERSIZE);
|
||||
int bufsize = DEFAULT_ZMQ_BUFFERSIZE;
|
||||
if (limit < DEFFAULT_LOW_ZMQ_HWM) {
|
||||
bufsize = DEFAULT_LOW_ZMQ_HWM_BUFFERSIZE;
|
||||
}
|
||||
SetReceiveBuffer(bufsize);
|
||||
}
|
||||
|
||||
int ZmqSocket::GetSendBuffer() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user