diff --git a/src/socket_base.cpp b/src/socket_base.cpp index b00b42bf..a0fc01ca 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -305,10 +305,15 @@ int zmq::socket_base_t::bind (const char *addr_) return -1; } + // Process pending commands, if any. + int rc = process_commands (0, false); + if (unlikely (rc != 0)) + return -1; + // Parse addr_ string. std::string protocol; std::string address; - int rc = parse_uri (addr_, protocol, address); + rc = parse_uri (addr_, protocol, address); if (rc != 0) return -1; @@ -387,10 +392,15 @@ int zmq::socket_base_t::connect (const char *addr_) return -1; } + // Process pending commands, if any. + int rc = process_commands (0, false); + if (unlikely (rc != 0)) + return -1; + // Parse addr_ string. std::string protocol; std::string address; - int rc = parse_uri (addr_, protocol, address); + rc = parse_uri (addr_, protocol, address); if (rc != 0) return -1;