mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-07 05:58:45 +01:00
Adding ZMQ_LAST_ENDPOINT for wildcard support on TCP and IPC sockets
This commit is contained in:
@@ -387,11 +387,17 @@ int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv4only_)
|
||||
addr_str [addr_str.size () - 1] == ']')
|
||||
addr_str = addr_str.substr (1, addr_str.size () - 2);
|
||||
|
||||
// Parse the port number (0 is not a valid port).
|
||||
uint16_t port = (uint16_t) atoi (port_str.c_str());
|
||||
if (port == 0) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
uint16_t port;
|
||||
if (port_str[0] == '*') {
|
||||
// Resolve wildcard to 0 to allow autoselection of port
|
||||
port = 0;
|
||||
} else {
|
||||
// Parse the port number (0 is not a valid port).
|
||||
port = (uint16_t) atoi (port_str.c_str());
|
||||
if (port == 0) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve the IP address.
|
||||
|
||||
Reference in New Issue
Block a user