mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 05:58:45 +01:00
Problem: wildcard port binding does not work with WS sockets
Solution: remove the path from the address when resolving
This commit is contained in:
@@ -206,7 +206,10 @@ int zmq::ws_listener_t::set_local_address (const char *addr_)
|
||||
if (rc != 0)
|
||||
return -1;
|
||||
|
||||
if (create_socket (addr_) == -1)
|
||||
// remove the path, otherwise resolving the port will fail with wildcard
|
||||
const char *delim = strrchr (addr_, '/');
|
||||
std::string host_port = std::string (addr_, delim - addr_);
|
||||
if (create_socket (host_port.c_str ()) == -1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user