diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-07-15 11:24:33 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-07-15 11:24:33 +0200 |
commit | c8e8f2a24cd339c548e06f75a3cef96454671a85 (patch) | |
tree | b8ea021d0755acedca74563cfc74921634071f83 /src/zmq_listener.cpp | |
parent | ba67eff167e94105b0975166a2192060ab125e58 (diff) |
ZMQ_IDENTITY socket option removed
This patch simplifies the whole codebase significantly,
including dropping depedency on libuuid.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/zmq_listener.cpp')
-rw-r--r-- | src/zmq_listener.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/zmq_listener.cpp b/src/zmq_listener.cpp index e3f3bd8..2d5e7bb 100644 --- a/src/zmq_listener.cpp +++ b/src/zmq_listener.cpp @@ -21,7 +21,8 @@ #include <new> #include "zmq_listener.hpp" -#include "zmq_init.hpp" +#include "transient_session.hpp" +#include "zmq_engine.hpp" #include "io_thread.hpp" #include "err.hpp" @@ -63,16 +64,21 @@ void zmq::zmq_listener_t::in_event () // TODO: Handle specific errors like ENFILE/EMFILE etc. if (fd == retired_fd) return; + // Create the engine object for this connection. + zmq_engine_t *engine = new (std::nothrow) zmq_engine_t (fd, options); + alloc_assert (engine); // Choose I/O thread to run connecter in. Given that we are already // running in an I/O thread, there must be at least one available. io_thread_t *io_thread = choose_io_thread (options.affinity); zmq_assert (io_thread); - // Create and launch an init object. - zmq_init_t *init = new (std::nothrow) zmq_init_t (io_thread, socket, - NULL, fd, options); - alloc_assert (init); - launch_child (init); + // Create and launch a session object. + transient_session_t *session = new (std::nothrow) + transient_session_t (io_thread, socket, options); + alloc_assert (session); + session->inc_seqnum (); + launch_child (session); + send_attach (session, engine, false); } |