summaryrefslogtreecommitdiff
path: root/src/app_thread.cpp
diff options
context:
space:
mode:
authormalosek <malosek@fastmq.com>2009-09-10 12:04:26 +0200
committermalosek <malosek@fastmq.com>2009-09-10 12:04:26 +0200
commit95944551be93665fe4dcadbe00168da553b7d82f (patch)
tree084ed6b5136c05c2f5ca1574aaac1cc4a282dc96 /src/app_thread.cpp
parent5acef9fc96280df934176b02de724eb904e4bba3 (diff)
parentb3f32e219ec15a582b6fd03b155e0861443690f6 (diff)
Merge branch 'master' of git@github.com:sustrik/zeromq2
Diffstat (limited to 'src/app_thread.cpp')
-rw-r--r--src/app_thread.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/app_thread.cpp b/src/app_thread.cpp
index bdceca5..2bcc724 100644
--- a/src/app_thread.cpp
+++ b/src/app_thread.cpp
@@ -35,6 +35,7 @@
#include "pipe.hpp"
#include "config.hpp"
#include "socket_base.hpp"
+#include "sub.hpp"
// If the RDTSC is available we use it to prevent excessive
// polling for commands. The nice thing here is that it will work on any
@@ -135,8 +136,21 @@ void zmq::app_thread_t::process_commands (bool block_, bool throttle_)
zmq::socket_base_t *zmq::app_thread_t::create_socket (int type_)
{
- // TODO: type is ignored for the time being.
- socket_base_t *s = new socket_base_t (this);
+ socket_base_t *s = NULL;
+ switch (type_) {
+ case ZMQ_SUB:
+ s = new sub_t (this);
+ break;
+ case ZMQ_P2P:
+ case ZMQ_PUB:
+ case ZMQ_REQ:
+ case ZMQ_REP:
+ s = new socket_base_t (this);
+ break;
+ default:
+ // TODO: This should be EINVAL.
+ zmq_assert (false);
+ }
zmq_assert (s);
s->set_index (sockets.size ());
sockets.push_back (s);