mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-09 07:16:04 +00:00
Problem: code lets CLIENT connect to CLIENT
This has no sense IMO; people who need this can still use DEALER-DEALER. Solution: let CLIENT talk only to SERVER.
This commit is contained in:
parent
87f2dff38c
commit
c5b1de368a
@ -74,7 +74,8 @@ const char *zmq::mechanism_t::socket_type_string (int socket_type) const
|
|||||||
{
|
{
|
||||||
static const char *names [] = {"PAIR", "PUB", "SUB", "REQ", "REP",
|
static const char *names [] = {"PAIR", "PUB", "SUB", "REQ", "REP",
|
||||||
"DEALER", "ROUTER", "PULL", "PUSH",
|
"DEALER", "ROUTER", "PULL", "PUSH",
|
||||||
"XPUB", "XSUB", "STREAM", "SERVER", "CLIENT"};
|
"XPUB", "XSUB", "STREAM",
|
||||||
|
"SERVER", "CLIENT"};
|
||||||
zmq_assert (socket_type >= 0 && socket_type <= 13);
|
zmq_assert (socket_type >= 0 && socket_type <= 13);
|
||||||
return names [socket_type];
|
return names [socket_type];
|
||||||
}
|
}
|
||||||
@ -190,7 +191,7 @@ bool zmq::mechanism_t::check_socket_type (const std::string& type_) const
|
|||||||
case ZMQ_SERVER:
|
case ZMQ_SERVER:
|
||||||
return type_ == "CLIENT";
|
return type_ == "CLIENT";
|
||||||
case ZMQ_CLIENT:
|
case ZMQ_CLIENT:
|
||||||
return type_ == "CLIENT" || type_ == "SERVER";
|
return type_ == "SERVER";
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user