summaryrefslogtreecommitdiff
path: root/src/session.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-12-23 19:37:56 +0100
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-12-23 19:37:56 +0100
commitaebff623f36efddc0de7a3192832b61802f8cec8 (patch)
treefd3c88417309994b72b5a33f152ba4b028930fa9 /src/session.hpp
parentb3bd4c15fe869de4f5c530ecc5942968677a85c3 (diff)
ZMQII-28: Bidirectional introduction on TCP connection establishment
Diffstat (limited to 'src/session.hpp')
-rw-r--r--src/session.hpp24
1 files changed, 18 insertions, 6 deletions
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&);
};