0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-01 10:50:28 +08:00

add process_commands() to the beginning of zmq_connect() and zmq_bind()

I believe there was a conception that zmq_connect() and zmq_bind() will be called
only at the socket creation time and therefore don't need it.
Now it is not true anymore.
This commit is contained in:
Sergey KHripchenko 2012-04-22 01:39:48 +04:00
parent 057fab09a8
commit f858321c1c

View File

@ -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;