From aebff623f36efddc0de7a3192832b61802f8cec8 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 23 Dec 2009 19:37:56 +0100 Subject: ZMQII-28: Bidirectional introduction on TCP connection establishment --- src/session.hpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/session.hpp') diff --git a/src/session.hpp b/src/session.hpp index 72e1d59..c60cfc7 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -34,8 +34,14 @@ namespace zmq { public: - session_t (object_t *parent_, socket_base_t *owner_, const char *name_, - const options_t &options_, bool reconnect_); + // Creates unnamed session. + session_t (object_t *parent_, socket_base_t *owner_, + const options_t &options_); + + // Creates named session. If name is NULL, transient session with + // auto-generated name is created. + session_t (object_t *parent_, socket_base_t *owner_, + const options_t &options_, const char *name_); // i_inout interface implementation. bool read (::zmq_msg_t *msg_); @@ -44,7 +50,7 @@ namespace zmq void detach (owned_t *reconnecter_); class io_thread_t *get_io_thread (); class socket_base_t *get_owner (); - const char *get_session_name (); + uint64_t get_ordinal (); // i_endpoint interface implementation. void attach_pipes (class reader_t *inpipe_, class writer_t *outpipe_); @@ -73,6 +79,15 @@ namespace zmq struct i_engine *engine; + enum { + transient, + named, + unnamed + } type; + + // Ordinal of the session (if any). + uint64_t ordinal; + // The name of the session. One that is used to register it with // socket-level repository of sessions. std::string name; @@ -80,9 +95,6 @@ namespace zmq // Inherited socket options. options_t options; - // If true, reconnection is required after connection breaks. - bool reconnect; - session_t (const session_t&); void operator = (const session_t&); }; -- cgit v1.2.3