From 32ded2b457b2102dba4c15e00363f031d212b1c4 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 16 Mar 2011 13:26:23 +0100 Subject: Duplicate identities now checked with zmq_connect Signed-off-by: Martin Sustrik --- src/connect_session.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/connect_session.hpp') diff --git a/src/connect_session.hpp b/src/connect_session.hpp index 327ad2d..93e2704 100644 --- a/src/connect_session.hpp +++ b/src/connect_session.hpp @@ -23,6 +23,7 @@ #include +#include "blob.hpp" #include "session.hpp" namespace zmq @@ -43,7 +44,7 @@ namespace zmq private: // Handlers for events from session base class. - void attached (const blob_t &peer_identity_); + bool attached (const blob_t &peer_identity_); void detached (); // Start the connection process. @@ -56,6 +57,13 @@ namespace zmq std::string protocol; std::string address; + // If true, the session was already connected to the peer. + bool connected; + + // Identity of the peer. If 'connected' is false, it has no meaning. + // Otherwise, if it's empty, the peer has transient identity. + blob_t peer_identity; + connect_session_t (const connect_session_t&); const connect_session_t &operator = (const connect_session_t&); }; -- cgit v1.2.3