radio-dish pattern

This commit is contained in:
somdoron
2016-01-27 18:19:14 +02:00
parent 511d701de3
commit b8425a25cf
16 changed files with 831 additions and 219 deletions

View File

@@ -74,9 +74,10 @@ const char *zmq::mechanism_t::socket_type_string (int socket_type) const
{
static const char *names [] = {"PAIR", "PUB", "SUB", "REQ", "REP",
"DEALER", "ROUTER", "PULL", "PUSH",
"XPUB", "XSUB", "STREAM",
"SERVER", "CLIENT"};
zmq_assert (socket_type >= 0 && socket_type <= 13);
"XPUB", "XSUB", "STREAM",
"SERVER", "CLIENT",
"RADIO", "DISH"};
zmq_assert (socket_type >= 0 && socket_type <= 15);
return names [socket_type];
}
@@ -192,6 +193,10 @@ bool zmq::mechanism_t::check_socket_type (const std::string& type_) const
return type_ == "CLIENT";
case ZMQ_CLIENT:
return type_ == "SERVER";
case ZMQ_RADIO:
return type_ == "DISH";
case ZMQ_DISH:
return type_ == "RADIO";
default:
break;
}