From c5b1de368a2425e5e94e3d2ae36abff06ac6c63c Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 11 Sep 2015 13:46:02 -0400 Subject: [PATCH] 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. --- src/mechanism.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mechanism.cpp b/src/mechanism.cpp index a3eb9d4f..8dd7f104 100644 --- a/src/mechanism.cpp +++ b/src/mechanism.cpp @@ -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", "DEALER", "ROUTER", "PULL", "PUSH", - "XPUB", "XSUB", "STREAM", "SERVER", "CLIENT"}; + "XPUB", "XSUB", "STREAM", + "SERVER", "CLIENT"}; zmq_assert (socket_type >= 0 && socket_type <= 13); return names [socket_type]; } @@ -190,7 +191,7 @@ bool zmq::mechanism_t::check_socket_type (const std::string& type_) const case ZMQ_SERVER: return type_ == "CLIENT"; case ZMQ_CLIENT: - return type_ == "CLIENT" || type_ == "SERVER"; + return type_ == "SERVER"; default: break; }