diff options
author | mruddy <6440430+mruddy@users.noreply.github.com> | 2018-08-24 20:42:03 -0400 |
---|---|---|
committer | mruddy <6440430+mruddy@users.noreply.github.com> | 2018-10-19 07:36:13 -0400 |
commit | a4edb168b635b6f5c36324e44961cd42cf9bbbaa (patch) | |
tree | b3d617db74c7b1f86ee79df156139627fb7cabfe /src/zmq/zmqabstractnotifier.h | |
parent | d387507aeca652a5569825af65243536f2ce26ea (diff) |
ZMQ: add options to configure outbound message high water mark, aka SNDHWM
Diffstat (limited to 'src/zmq/zmqabstractnotifier.h')
-rw-r--r-- | src/zmq/zmqabstractnotifier.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h index 5081c6cd02..887dde7b27 100644 --- a/src/zmq/zmqabstractnotifier.h +++ b/src/zmq/zmqabstractnotifier.h @@ -15,7 +15,9 @@ typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)(); class CZMQAbstractNotifier { public: - CZMQAbstractNotifier() : psocket(nullptr) { } + static const int DEFAULT_ZMQ_SNDHWM {1000}; + + CZMQAbstractNotifier() : psocket(nullptr), outbound_message_high_water_mark(DEFAULT_ZMQ_SNDHWM) { } virtual ~CZMQAbstractNotifier(); template <typename T> @@ -28,6 +30,12 @@ public: void SetType(const std::string &t) { type = t; } std::string GetAddress() const { return address; } void SetAddress(const std::string &a) { address = a; } + int GetOutboundMessageHighWaterMark() const { return outbound_message_high_water_mark; } + void SetOutboundMessageHighWaterMark(const int sndhwm) { + if (sndhwm >= 0) { + outbound_message_high_water_mark = sndhwm; + } + } virtual bool Initialize(void *pcontext) = 0; virtual void Shutdown() = 0; @@ -39,6 +47,7 @@ protected: void *psocket; std::string type; std::string address; + int outbound_message_high_water_mark; // aka SNDHWM }; #endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H |