From 4914e5c9d192ac6763e5da6fa28ea503ee769bf0 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 2 Sep 2009 16:16:25 +0200 Subject: O(1) socket removal --- src/socket_base.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/socket_base.hpp') diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 284d2c4..3f5774f 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -66,6 +66,10 @@ namespace zmq void detach_inpipe (class reader_t *pipe_); void detach_outpipe (class writer_t *pipe_); + // Manipulating index in the app_thread's list of sockets. + void set_index (int index); + int get_index (); + private: // Handlers for incoming commands. @@ -131,6 +135,9 @@ namespace zmq sessions_t sessions; mutex_t sessions_sync; + // Index of the socket in the app_thread's list of sockets. + int index; + socket_base_t (const socket_base_t&); void operator = (const socket_base_t&); }; -- cgit v1.2.3