We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int rv = 0; auto context = zmq_init(1); auto socket = zmq_socket(context,ZMQ_STREAM); rv = zmq_connect(socket,ADDRESS); assert(rv==0); std::string id; id.resize(5); size_t sz = 5; rv = zmq_getsockopt(socket,ZMQ_IDENTITY,id.data(),&sz);
can get ZMQ_IDENTITY. e.g. k�Eg.
ZMQ_IDENTITY
k�Eg
boost::asio::io_context ioc; azmq::socket client(ioc,ZMQ_STREAM); client.connect(ADDRESS); azmq::socket::identity id; client.get_option(id); //throw Boost::system_error: Invalid argument
now ZMQ_IDENTITY renamed ZMQ_ROUTING_ID.
ZMQ_ROUTING_ID
zmq:4.3.2
4.3.2
boost: 1.7.1
1.7.1
azmq:github-lasted: 19.11.1
github-lasted: 19.11.1
The text was updated successfully, but these errors were encountered:
I found the reason.
//main.cpp azmq::socket::identity id; //typename opt::binary<ZMQ_IDENTITY> // it create with default constructor,so // id.size = 0. //socket_ops.hpp //when it do this func: template<typename Option> static boost::system::error_code get_option(socket_type & socket, Option & opt, boost::system::error_code & ec) { BOOST_ASSERT_MSG(socket, "invalid socket"); size_t size = opt.size(); auto rc = zmq_getsockopt(socket.get(), opt.name(), opt.data(), &size); //if size = 0 ,rc = -1; if (rc < 0) ec = make_error_code(); return ec; }
boost::asio::io_context ioc; azmq::socket client(ioc,ZMQ_STREAM); client.connect(ADDRESS); string id_str('0',5); azmq::socket::identity id(id_str); client.get_option(id);
Is it possible to add a constructor for this option?
binary(size_t sz) { data_.resize(sz); pv_ = data_.data(); size_ = sz; }
Sorry, something went wrong.
No branches or pull requests
ZMQ
can get
ZMQ_IDENTITY
. e.g.k�Eg
.AZMQ
other
now
ZMQ_IDENTITY
renamedZMQ_ROUTING_ID
.version
zmq:
4.3.2
boost:
1.7.1
azmq:
github-lasted: 19.11.1
The text was updated successfully, but these errors were encountered: