mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-15 18:38:00 +08:00
Set errno and update documentation on zmq_disconnect
This commit is contained in:
parent
2388f27bfe
commit
b0563c2103
@ -34,6 +34,8 @@ The endpoint supplied is invalid.
|
||||
The 0MQ 'context' associated with the specified 'socket' was terminated.
|
||||
*ENOTSOCK*::
|
||||
The provided 'socket' was invalid.
|
||||
*ENOTCONN*::
|
||||
The provided endpoint is not connected.
|
||||
|
||||
|
||||
EXAMPLE
|
||||
|
@ -602,8 +602,10 @@ int zmq::socket_base_t::term_endpoint (const char *addr_)
|
||||
// Disconnect an inproc socket
|
||||
if (protocol == "inproc") {
|
||||
std::pair <inprocs_t::iterator, inprocs_t::iterator> range = inprocs.equal_range (std::string (addr_));
|
||||
if (range.first == range.second)
|
||||
if (range.first == range.second) {
|
||||
errno = ENOTCONN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (inprocs_t::iterator it = range.first; it != range.second; ++it)
|
||||
it->second->terminate(true);
|
||||
@ -614,8 +616,10 @@ int zmq::socket_base_t::term_endpoint (const char *addr_)
|
||||
|
||||
// Find the endpoints range (if any) corresponding to the addr_ string.
|
||||
std::pair <endpoints_t::iterator, endpoints_t::iterator> range = endpoints.equal_range (std::string (addr_));
|
||||
if (range.first == range.second)
|
||||
if (range.first == range.second) {
|
||||
errno = ENOTCONN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (endpoints_t::iterator it = range.first; it != range.second; ++it)
|
||||
term_child (it->second);
|
||||
|
Loading…
x
Reference in New Issue
Block a user