Allowing value 0, and moving code to get_address functions based on feedback

This commit is contained in:
Ian Barber
2012-02-11 15:09:03 +00:00
parent 91bf4944da
commit 770f84331f
6 changed files with 41 additions and 44 deletions

View File

@@ -388,7 +388,8 @@ int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv4only_)
addr_str = addr_str.substr (1, addr_str.size () - 2);
uint16_t port;
if (port_str[0] == '*') {
// Allow 0 specifically, to detect invalid port error in atoi if not
if (port_str[0] == '*' || port_str[0] == '0') {
// Resolve wildcard to 0 to allow autoselection of port
port = 0;
} else {