1
.TH zmq_cpp 7 "" "(c)2007-2010 iMatix Corporation" "0MQ User Manuals"
3
C++ API for 0MQ lightweight messaging kernel
6
This manual page explains how C++ API maps to underlying C API. To learn about
7
individual functions and parameters check appropriate C API manual
10
For example, to understand
11
.IR zmq::socket_t::setsockopt
13
.BR zmq_setsockopt(3) .
15
All 0MQ constants defined with C API are available with C++ API.
19
This class encapsulates the functions dealing with initialisation and
20
termination of 0MQ context. Constructor of the class invokes
22
while destructor calls
27
This class encapsulates all the functions to deal with 0MQ sockets. Constructor
32
Other functions of the class are mapped to C functions with corresponding names.
33
.IR zmq::socket_t::bind
40
This class encapsulates
42
structure and all the C functions that deal with 0MQ messages.
43
Constructors of the class invoke corresponding initialisation functions (
45
.BR zmq_msg_init_size(3)
47
.BR zmq_msg_init_data(3) ,
48
while destructor invokes
52
Remaining functions are mapped to C functions with corresponding names.
54
.IR zmq::message_t::copy
59
C++ provides an additional function not avialable with C API.
60
.IR zmq::message_t::rebuild
61
is equivalent to calling
65
.BR zmq_msg_init_size (3)
67
.BR zmq_msg_init_data(3) .
68
It provides a way to reuse existing
70
instances to store different message content.
74
All the errors reported using
76
mechanism in C API are automatically converted to exceptions in C++ API.
82
function to convert the error code to human-readable string.
87
function is a namespaced equivalent of raw C
93
zmq::context_t ctx (1, 1);
94
zmq::socket_t s (ctx, ZMQ_PUB);
95
s.connect ("tcp://192.168.0.115:5555");
96
zmq::message_t msg (100);
97
memset (msg.data (), 0, 100);
103
Martin Sustrik <sustrik at 250bpm dot com>