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 <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik
2011-09-15 10:00:23 +02:00
parent 78b02d142e
commit f78d9b6bfc
50 changed files with 494 additions and 82 deletions

View File

@@ -39,7 +39,7 @@
#include "vtcp_listener.hpp"
#include "tcp_connecter.hpp"
#include "io_thread.hpp"
#include "session.hpp"
#include "session_base.hpp"
#include "config.hpp"
#include "clock.hpp"
#include "pipe.hpp"
@@ -480,9 +480,9 @@ int zmq::socket_base_t::connect (const char *addr_)
}
// Create session.
session_t *session = new (std::nothrow) session_t (
io_thread, true, this, options, protocol.c_str (), address.c_str ());
alloc_assert (session);
session_base_t *session = session_base_t::create (io_thread, true, this,
options, protocol.c_str (), address.c_str ());
errno_assert (session);
// Create a bi-directional pipe.
object_t *parents [2] = {this, session};