From 0a03e86e9547fa7c221b316a5a943467adea3dfd Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 16 Oct 2010 10:53:29 +0200 Subject: ZMQ_LINGER socket option added. 1. ZMQ_LINGER option can be set/get 2. options are part of own_t base class rather than being declared separately by individual objects 3. Linger option is propagated with "term" command so that the newest value of it is used rather than the stored old one. 4. Session sets the linger timer if needed and terminates as soon as it expires. 5. Corresponding documentation updated. Signed-off-by: Martin Sustrik --- src/own.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/own.hpp') diff --git a/src/own.hpp b/src/own.hpp index 6b6f7bf..18f7251 100644 --- a/src/own.hpp +++ b/src/own.hpp @@ -24,6 +24,7 @@ #include #include "object.hpp" +#include "options.hpp" #include "atomic_counter.hpp" #include "stdint.hpp" @@ -45,7 +46,7 @@ namespace zmq own_t (class ctx_t *parent_, uint32_t slot_); // The object is living within I/O thread. - own_t (class io_thread_t *io_thread_); + own_t (class io_thread_t *io_thread_, const options_t &options_); // When another owned object wants to send command to this object // it calls this function to let it know it should not shut down @@ -83,12 +84,15 @@ namespace zmq // Term handler is protocted rather than private so that it can // be intercepted by the derived class. This is useful to add custom // steps to the beginning of the termination process. - void process_term (); + void process_term (int linger_); // A place to hook in when phyicallal destruction of the object // is to be delayed. virtual void process_destroy (); + // Socket options associated with this object. + options_t options; + private: // Set owner of the object -- cgit v1.2.3