summaryrefslogtreecommitdiff
path: root/src/ctx.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:57:38 +0200
committerMartin Sustrik <sustrik@250bpm.com>2010-09-01 07:57:38 +0200
commitce0972dca3982538fd123b61fbae3928fad6d1e7 (patch)
treef15d4de3c7dd2aadc3c25b6f8a602c4fe64a334d /src/ctx.hpp
parentdb73c76314d7109da4b400a3edb107c4eda802a2 (diff)
context creates an inproc endpoint ('inproc://log') to distribute 0MQ's log messages
Diffstat (limited to 'src/ctx.hpp')
-rw-r--r--src/ctx.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ctx.hpp b/src/ctx.hpp
index a31e1d8..5f6cc83 100644
--- a/src/ctx.hpp
+++ b/src/ctx.hpp
@@ -24,6 +24,8 @@
#include <vector>
#include <string>
+#include "../include/zmq.h"
+
#include "signaler.hpp"
#include "semaphore.hpp"
#include "ypipe.hpp"
@@ -74,6 +76,9 @@ namespace zmq
void unregister_endpoints (class socket_base_t *socket_);
class socket_base_t *find_endpoint (const char *addr_);
+ // Logging.
+ void log (zmq_msg_t *msg_);
+
private:
~ctx_t ();
@@ -125,6 +130,11 @@ namespace zmq
// Synchronisation of access to the list of inproc endpoints.
mutex_t endpoints_sync;
+ // PUB socket for logging. The socket is shared among all the threads,
+ // thus it is synchronised by a mutex.
+ class socket_base_t *log_socket;
+ mutex_t log_sync;
+
ctx_t (const ctx_t&);
void operator = (const ctx_t&);
};