From bd0ba6e89a709cc8afbd5a7c3c4f9f533c428249 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 10 Jan 2011 13:53:30 +0100 Subject: Size of inproc hwm and swap is sum of peers' hwms and swaps The meat of the patch was contributed by Douglas Creager. Martin Sustrik implemented storing peer options in inproc endpoint repository. Signed-off-by: Martin Sustrik --- src/ctx.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/ctx.hpp') diff --git a/src/ctx.hpp b/src/ctx.hpp index 0f2dd52..f35aa12 100644 --- a/src/ctx.hpp +++ b/src/ctx.hpp @@ -34,9 +34,18 @@ #include "mutex.hpp" #include "stdint.hpp" #include "thread.hpp" +#include "options.hpp" namespace zmq { + // Information associated with inproc endpoint. Note that endpoint options + // are registered as well so that the peer can access them without a need + // for synchronisation, handshaking or similar. + struct endpoint_t + { + class socket_base_t *socket; + options_t options; + }; // Context object encapsulates all the global state associated with // the library. @@ -70,9 +79,9 @@ namespace zmq class io_thread_t *choose_io_thread (uint64_t affinity_); // Management of inproc endpoints. - int register_endpoint (const char *addr_, class socket_base_t *socket_); + int register_endpoint (const char *addr_, endpoint_t &endpoint_); void unregister_endpoints (class socket_base_t *socket_); - class socket_base_t *find_endpoint (const char *addr_); + endpoint_t find_endpoint (const char *addr_); // Logging. void log (zmq_msg_t *msg_); @@ -122,7 +131,7 @@ namespace zmq mailbox_t **slots; // List of inproc endpoints within this context. - typedef std::map endpoints_t; + typedef std::map endpoints_t; endpoints_t endpoints; // Synchronisation of access to the list of inproc endpoints. -- cgit v1.2.3