From f78d9b6bfca13e298c29fadabbbc870b37a0a573 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 15 Sep 2011 10:00:23 +0200 Subject: Session class separated into socket-type-specific sessions This is a preliminary patch allowing for socket-type-specific functionality in the I/O thread. For example, message format can be checked asynchronously and misbehaved connections dropped straight away. Signed-off-by: Martin Sustrik --- src/tcp_listener.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tcp_listener.cpp') diff --git a/src/tcp_listener.cpp b/src/tcp_listener.cpp index da476a4..9b6068c 100644 --- a/src/tcp_listener.cpp +++ b/src/tcp_listener.cpp @@ -26,7 +26,7 @@ #include "tcp_listener.hpp" #include "stream_engine.hpp" #include "io_thread.hpp" -#include "session.hpp" +#include "session_base.hpp" #include "config.hpp" #include "err.hpp" #include "ip.hpp" @@ -97,9 +97,9 @@ void zmq::tcp_listener_t::in_event () zmq_assert (io_thread); // Create and launch a session object. - session_t *session = new (std::nothrow) - session_t (io_thread, false, socket, options, NULL, NULL); - alloc_assert (session); + session_base_t *session = session_base_t::create (io_thread, false, socket, + options, NULL, NULL); + errno_assert (session); session->inc_seqnum (); launch_child (session); send_attach (session, engine, false); -- cgit v1.2.3