From 0f6f7276e32c01ccfe86fb76741a52ac6ffc87af Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 23 May 2011 20:30:01 +0200 Subject: Move the pipe termination code to socket_base_t So far, the pipe termination code was spread among socket type classes, fair queuer, load balancer, etc. This patch moves all the associated logic to a single place. Signed-off-by: Martin Sustrik --- src/xrep.hpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/xrep.hpp') diff --git a/src/xrep.hpp b/src/xrep.hpp index d0378c2..fbc7385 100644 --- a/src/xrep.hpp +++ b/src/xrep.hpp @@ -26,7 +26,6 @@ #include "socket_base.hpp" #include "blob.hpp" -#include "pipe.hpp" #include "msg.hpp" namespace zmq @@ -34,8 +33,7 @@ namespace zmq // TODO: This class uses O(n) scheduling. Rewrite it to use O(1) algorithm. class xrep_t : - public socket_base_t, - public i_pipe_events + public socket_base_t { public: @@ -48,6 +46,9 @@ namespace zmq int xrecv (class msg_t *msg_, int flags_); bool xhas_in (); bool xhas_out (); + void xread_activated (class pipe_t *pipe_); + void xwrite_activated (class pipe_t *pipe_); + void xterminated (class pipe_t *pipe_); protected: @@ -56,14 +57,6 @@ namespace zmq private: - // Hook into the termination process. - void process_term (int linger_); - - // i_pipe_events interface implementation. - void read_activated (pipe_t *pipe_); - void write_activated (pipe_t *pipe_); - void terminated (pipe_t *pipe_); - struct inpipe_t { class pipe_t *pipe; @@ -103,9 +96,6 @@ namespace zmq // If true, more outgoing message parts are expected. bool more_out; - // If true, termination process is already underway. - bool terminating; - xrep_t (const xrep_t&); const xrep_t &operator = (const xrep_t&); }; -- cgit v1.2.3