1ZMQ_MSG_INIT(3)                   0MQ Manual                   ZMQ_MSG_INIT(3)
2
3
4

NAME

6       zmq_msg_init - initialise empty 0MQ message
7

SYNOPSIS

9       int zmq_msg_init (zmq_msg_t *msg);
10

DESCRIPTION

12       The zmq_msg_init() function shall initialise the message object
13       referenced by msg to represent an empty message. This function is most
14       useful when called before receiving a message with zmq_recv().
15
16           Caution
17           Never access zmq_msg_t members directly, instead always use the
18           zmq_msg family of functions.
19
20           Caution
21           The functions zmq_msg_init(), zmq_msg_init_data() and
22           zmq_msg_init_size() are mutually exclusive. Never initialize the
23           same zmq_msg_t twice.
24

RETURN VALUE

26       The zmq_msg_init() function shall return zero if successful. Otherwise
27       it shall return -1 and set errno to one of the values defined below.
28

ERRORS

30       No errors are defined.
31

EXAMPLE

33       Receiving a message from a socket.
34
35           zmq_msg_t msg;
36           rc = zmq_msg_init (&msg);
37           assert (rc == 0);
38           rc = zmq_recv (socket, &msg, 0);
39           assert (rc == 0);
40
41

SEE ALSO

43       zmq_msg_init_size(3) zmq_msg_init_data(3) zmq_msg_close(3)
44       zmq_msg_data(3) zmq_msg_size(3) zmq(7)
45

AUTHORS

47       This 0MQ manual page was written by Martin Sustrik
48       <sustrik@250bpm.com[1]> and Martin Lucina <mato@kotelna.sk[2]>.
49

NOTES

51        1. sustrik@250bpm.com
52           mailto:sustrik@250bpm.com
53
54        2. mato@kotelna.sk
55           mailto:mato@kotelna.sk
56
57
58
590MQ 2.1.4                         03/30/2011                   ZMQ_MSG_INIT(3)
Impressum