mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-10 08:08:33 +01:00
context creates an inproc endpoint ('inproc://log') to distribute 0MQ's log messages
This commit is contained in:
10
src/ctx.hpp
10
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&);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user