Open fengmao31 opened 1 year ago
It is because in a huge while. the stack variable is created and destroyed repeatly. while the zmq::context_t context and zmq::socket_t publisher is not in the while. only the make _unique operating in the while.
But why repeatly make _unique looks like not realloc the momery?
Please use this template for reporting suspected bugs or requests for help.
Environment
Issue description
I find subscriber and publisher show different situation with differet created way when they receive messages. I test the different situation that zmq publisher use stack or heap, while zmq recevier use stack
Experiment
publisher
when I use stack to create zmq::context_t and zmq::socket_t, zmq subscriber lost first messages from zmq publisher.
when I use heap to create zmq::context_t and zmq::socket_t, zmq subscriber can get all messages from zmq publisher.
subscriber