Closed pi1ot closed 2 years ago
This is because an exception is thrown from unbind. This is because the address is wildcard. Try unbinding with the result from
std::string last_endpoint =
socket.get(zmq::sockopt::last_endpoint);
This is because an exception is thrown from unbind. This is because the address is wildcard. Try unbinding with the result from
std::string last_endpoint = socket.get(zmq::sockopt::last_endpoint);
Thanks! unbind success now, but bind and unbind udp address still crash, even unbind sockopt::last_endpoint address
#include "zmq/zmq.hpp"
int main() {
zmq::context_t ctx = ::zmq::context_t();
zmq::socket_t socket(ctx, zmq::socket_type::dish);
socket.bind("udp://224.0.0.130:7714");
socket.unbind(socket.get(zmq::sockopt::last_endpoint)); // <- still crash here
socket.close();
}
Try catching exceptions, and try printing what last endpoint is. Maybe this does not work for UDP.
Try catching exceptions, and try printing what last endpoint is. Maybe this does not work for UDP.
last endpoint is same as bind address:"224.0.0.130:7714",and exception is "Invalid argument"
This looks like an issue with https://github.com/zeromq/libzmq, try submitting an issue there if this is still a problem.
I dont know why these code crash at unbind(), comment unbind line will be ok. libzmq v4.3.4 cppzmq v4.8.0 ubuntu 18.04 x86-64