Skip to content

Commit

Permalink
Set ZMQSubscriber socket options before opening the socket (#45)
Browse files Browse the repository at this point in the history
* The conflate option must be set before connection, otherwise
it has no effect and messages build up in the queue
  • Loading branch information
eeberhard authored Jun 11, 2023
1 parent 6486755 commit c6563a0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ ZMQSubscriber::ZMQSubscriber(ZMQSocketConfiguration configuration) : ZMQSocket(s

void ZMQSubscriber::open() {
this->socket_ = std::make_shared<zmq::socket_t>(*this->config_.context, ZMQ_SUB);
this->open_socket();
this->socket_->set(zmq::sockopt::conflate, 1);
this->socket_->set(zmq::sockopt::subscribe, "");
this->open_socket();
}

bool ZMQSubscriber::send_bytes(const std::string&) {
Expand Down

0 comments on commit c6563a0

Please sign in to comment.