What's the actual result? (include assertion message & call stack if applicable)
By tracking the source code,the setsockopt function stores the correct value.
int zmq::optionst::setsockopt (int option,
const void *optval_,
sizet optvallen) :options.cpp
But in the tune_socket function, it becomes -1。
bool zmq::tcp_connecter_t::tune_socket (const fdt fd) :tcp_connecter.cpp
Please use this template for reporting suspected bugs or requests for help.
Issue description
One end uses ZMQ_PUB to send data, and the other end uses ZMQSUB to receive data,ZMQ TCP KEEPALIVE IDLE does not work in ZMQSUB mode. ZMQPUB is ok.
Environment
Minimal test code / Steps to reproduce the issue
zmqSubscriber_ = zmq_socket(, ZMQ_SUB); zmq_socketmonitor(zmqSubscriber, , ZMQ_EVENT_ALL); zmqconnect(zmqSubscriber, ); zmqsetsockopt(zmqSubscriber, ZMQ_SUBSCRIBE, ); int r = 1; zmqsetsockopt(zmqSubscriber, ZMQ_CONFLATE, &r, sizeof(r)); r = 5; zmqsetsockopt(zmqSubscriber, ZMQ_TCP_KEEPALIVE_IDLE, &r, sizeof(r)); zmqsetsockopt(zmqSubscriber, ZMQ_TCP_KEEPALIVE_CNT, &r, sizeof(r)); r = 1; zmqsetsockopt(zmqSubscriber, ZMQ_TCP_KEEPALIVE_INTVL, &r, sizeof(r)); zmqsetsockopt(zmqSubscriber, ZMQ_TCP_KEEPALIVE, &r, sizeof(r));
What's the actual result? (include assertion message & call stack if applicable)
By tracking the source code,the setsockopt function stores the correct value. int zmq::optionst::setsockopt (int option, const void *optval_, sizet optvallen) :options.cpp
But in the tune_socket function, it becomes -1。 bool zmq::tcp_connecter_t::tune_socket (const fdt fd) :tcp_connecter.cpp
What's the expected result?
I hope the KEEPALIVE mechanism can work。