diff options
| author | mruddy <[email protected]> | 2018-11-08 06:38:21 -0500 |
|---|---|---|
| committer | mruddy <[email protected]> | 2018-11-15 08:16:25 -0500 |
| commit | c276df775914e4e42993c76e172ef159e3b830d4 (patch) | |
| tree | 8bba4fee9755974b946a1d95aac811aa1c8b61e0 /src | |
| parent | Merge #14411: [wallet] Restore ability to list incoming transactions by label (diff) | |
| download | discoin-c276df775914e4e42993c76e172ef159e3b830d4.tar.xz discoin-c276df775914e4e42993c76e172ef159e3b830d4.zip | |
zmq: enable tcp keepalive
Diffstat (limited to 'src')
| -rw-r--r-- | src/zmq/zmqpublishnotifier.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp index 15d4ac1b8..e2177efe5 100644 --- a/src/zmq/zmqpublishnotifier.cpp +++ b/src/zmq/zmqpublishnotifier.cpp @@ -86,6 +86,14 @@ bool CZMQAbstractPublishNotifier::Initialize(void *pcontext) return false; } + const int so_keepalive_option {1}; + rc = zmq_setsockopt(psocket, ZMQ_TCP_KEEPALIVE, &so_keepalive_option, sizeof(so_keepalive_option)); + if (rc != 0) { + zmqError("Failed to set SO_KEEPALIVE"); + zmq_close(psocket); + return false; + } + rc = zmq_bind(psocket, address.c_str()); if (rc != 0) { |