summaryrefslogtreecommitdiff
path: root/src/session.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@fastmq.commkdir>2009-08-27 16:24:21 +0200
committerMartin Sustrik <sustrik@fastmq.commkdir>2009-08-27 16:24:21 +0200
commit2dd501651592baa7f9e49f52e1321ae2b9b4e126 (patch)
treefe5d221061004894eb259304fcdbd4f8092de99d /src/session.cpp
parent67194267f89d63391288600f127205a2b7a8a5ae (diff)
multiple bugs fixed
Diffstat (limited to 'src/session.cpp')
-rw-r--r--src/session.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/session.cpp b/src/session.cpp
index 115fb85..0b1b947 100644
--- a/src/session.cpp
+++ b/src/session.cpp
@@ -26,7 +26,7 @@ zmq::session_t::session_t (object_t *parent_, socket_base_t *owner_,
const char *name_, const options_t &options_) :
owned_t (parent_, owner_),
in_pipe (NULL),
- active (false),
+ active (true),
out_pipe (NULL),
engine (NULL),
name (name_),
@@ -74,6 +74,16 @@ void zmq::session_t::flush ()
out_pipe->flush ();
}
+void zmq::session_t::detach ()
+{
+ // Engine is terminating itself.
+ engine = NULL;
+
+ // TODO: In the case od anonymous connection, terminate the session.
+// if (anonymous)
+// term ();
+}
+
void zmq::session_t::revive (reader_t *pipe_)
{
zmq_assert (in_pipe == pipe_);
@@ -98,6 +108,7 @@ void zmq::session_t::process_plug ()
pipe_t *inbound = new pipe_t (this, owner, options.hwm, options.lwm);
zmq_assert (inbound);
in_pipe = &inbound->reader;
+ in_pipe->set_endpoint (this);
pipe_t *outbound = new pipe_t (owner, this, options.hwm, options.lwm);
zmq_assert (outbound);
out_pipe = &outbound->writer;