From 0b59866a84f733e5a53b0d2f32570581691747ef Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Mon, 30 May 2011 10:07:34 +0200 Subject: Patches from sub-forward branch incorporated Signed-off-by: Martin Sustrik --- src/pipe.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/pipe.hpp') diff --git a/src/pipe.hpp b/src/pipe.hpp index 3087ab8..bf34a83 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -44,6 +44,7 @@ namespace zmq virtual void read_activated (class pipe_t *pipe_) = 0; virtual void write_activated (class pipe_t *pipe_) = 0; + virtual void hiccuped (class pipe_t *pipe_) = 0; virtual void terminated (class pipe_t *pipe_) = 0; }; @@ -86,6 +87,11 @@ namespace zmq // Flush the messages downsteam. void flush (); + // Temporaraily disconnects the inbound message stream and drops + // all the messages on the fly. Causes 'hiccuped' event to be generated + // in the peer. + void hiccup (); + // Ask pipe to terminate. The termination will happen asynchronously // and user will be notified about actual deallocation by 'terminated' // event. @@ -93,18 +99,19 @@ namespace zmq private: + // Type of the underlying lock-free pipe. + typedef ypipe_t upipe_t; + // Command handlers. void process_activate_read (); void process_activate_write (uint64_t msgs_read_); + void process_hiccup (void *pipe_); void process_pipe_term (); void process_pipe_term_ack (); // Handler for delimiter read from the pipe. void delimit (); - // Type of the underlying lock-free pipe. - typedef ypipe_t upipe_t; - // Constructor is private. Pipe can only be created using // pipepair function. pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, -- cgit v1.2.3