libzmq
libzmq copied to clipboard
Calling unbind() on a UDP DISH always returns ENOENT, unconditionally.
Please use this template for reporting suspected bugs or requests for help.
Issue description
Calling unbind on a UDP DISH returns ENOENT under all circumstances.
Probable cause, see endpoint.hpp:
const std::string &identifier () const
{
return local_type == endpoint_type_bind ? local : remote;
}
UDP sockets are endpoint_type_none and therefore, identifier() will return the remote address, which can't exist.
Change to
return local_type != endpoint_type_connect ? local : remote;
should fix this, I assume.
- libzmq version (commit hash if unreleased): 4.3.5
- OS: Tested on Windows
Minimal test code / Steps to reproduce the issue
zmq::socket_t socket(context, ZMQ_DISH);
socket.bind("udp://*:5555");
socket.unbind("udp://*:5555"); // BANG, same with "udp://0.0.0.0:5555"
What's the actual result? (include assertion message & call stack if applicable)
Socket doesn't get unbound, instead unbind() returns ENOENT
What's the expected result?
Unbound socket, silence, peace, zen...