Skip to content
New issue

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

Calling unbind() on a UDP DISH always returns ENOENT, unconditionally. #4728

Open
stitch3210 opened this issue Aug 19, 2024 · 0 comments
Open

Comments

@stitch3210
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant