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/session.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/session.hpp') diff --git a/src/session.hpp b/src/session.hpp index 499c074..570daa1 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -69,12 +69,16 @@ namespace zmq void terminate (); // Two events for the derived session type. Attached is triggered - // when session is attached to a peer, detached is triggered at the - // beginning of the termination process when session is about to - // be detached from the peer. - virtual void attached (const blob_t &peer_identity_) = 0; + // when session is attached to a peer. The function can reject the new + // peer by returning false. Detached is triggered at the beginning of + // the termination process when session is about to be detached from + // the peer. + virtual bool attached (const blob_t &peer_identity_) = 0; virtual void detached () = 0; + // Returns true if there is an engine attached to the session. + bool has_engine (); + // Allows derives session types to (un)register session names. bool register_session (const blob_t &name_, class session_t *session_); void unregister_session (const blob_t &name_); -- cgit v1.2.3