示例#1
0
文件: zmq.hpp 项目: ATNF/askapsdp
        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);
        }
示例#2
0
 inline ~context_t ()
 {
     if (ptr == NULL)
         return;
     int rc = zmq_term (ptr);
     ZMQ_ASSERT (rc == 0);
 }
示例#3
0
 inline void close()
 {
     if (ptr == NULL)
         return;
     int rc = zmq_ctx_destroy (ptr);
     ZMQ_ASSERT (rc == 0);
     ptr = NULL;
 }
示例#4
0
 inline void close()
 {
     if (ptr == NULL)
         return;
     int rc = zmq_term (ptr);
     ZMQ_ASSERT (rc == 0);
     ptr = NULL;
 }
示例#5
0
 inline void close()
 {
     if(ptr == NULL)
         // already closed
         return ;
     int rc = zmq_close (ptr);
     ZMQ_ASSERT (rc == 0);
     ptr = 0 ;
 }
示例#6
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);
        }
示例#7
0
 inline ~message_t ()
 {
     int rc = zmq_msg_close (&msg);
     ZMQ_ASSERT (rc == 0);
 }