summaryrefslogtreecommitdiff
path: root/src/ctx.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-01-10 13:53:30 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-01-10 13:53:30 +0100
commitbd0ba6e89a709cc8afbd5a7c3c4f9f533c428249 (patch)
tree4b63b8e4f9d222dfcdc66cf0e20859fa17826610 /src/ctx.hpp
parentbabdf48aacc585d57457da8dec1fb6ce262bf719 (diff)
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 <sustrik@250bpm.com>
Diffstat (limited to 'src/ctx.hpp')
-rw-r--r--src/ctx.hpp15
1 files changed, 12 insertions, 3 deletions
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 <std::string, class socket_base_t*> endpoints_t;
+ typedef std::map <std::string, endpoint_t> endpoints_t;
endpoints_t endpoints;
// Synchronisation of access to the list of inproc endpoints.