inline explicit context_t (int io_threads_, int max_sockets_ = 1024) { ptr = zmq_ctx_new (); if (ptr == NULL) throw error_t (); int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_); ZMQ_ASSERT (rc == 0); rc = zmq_ctx_set (ptr, ZMQ_MAX_SOCKETS, max_sockets_); ZMQ_ASSERT (rc == 0); }
inline ~context_t () { if (ptr == NULL) return; int rc = zmq_term (ptr); ZMQ_ASSERT (rc == 0); }
inline void close() { if (ptr == NULL) return; int rc = zmq_ctx_destroy (ptr); ZMQ_ASSERT (rc == 0); ptr = NULL; }
inline void close() { if (ptr == NULL) return; int rc = zmq_term (ptr); ZMQ_ASSERT (rc == 0); ptr = NULL; }
inline void close() { if(ptr == NULL) // already closed return ; int rc = zmq_close (ptr); ZMQ_ASSERT (rc == 0); ptr = 0 ; }
inline explicit context_t (int io_threads_) { ptr = zmq_ctx_new (); if (ptr == NULL) throw error_t (); int rc = zmq_ctx_set (ptr, ZMQ_IO_THREADS, io_threads_); ZMQ_ASSERT (rc == 0); }
inline ~message_t () { int rc = zmq_msg_close (&msg); ZMQ_ASSERT (rc == 0); }