~ubuntu-branches/ubuntu/saucy/zeromq3/saucy

« back to all changes in this revision

Viewing changes to doc/zmq_msg_init.txt

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-06-04 21:21:09 UTC
  • Revision ID: package-import@ubuntu.com-20120604212109-b7b3m0rn21o8oo2q
Tags: upstream-3.1.0~beta+dfsg
ImportĀ upstreamĀ versionĀ 3.1.0~beta+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
zmq_msg_init(3)
 
2
===============
 
3
 
 
4
 
 
5
NAME
 
6
----
 
7
zmq_msg_init - initialise empty 0MQ message
 
8
 
 
9
 
 
10
SYNOPSIS
 
11
--------
 
12
*int zmq_msg_init (zmq_msg_t '*msg');*
 
13
 
 
14
 
 
15
DESCRIPTION
 
16
-----------
 
17
The _zmq_msg_init()_ function shall initialise the message object referenced by
 
18
'msg' to represent an empty message.  This function is most useful when called
 
19
before receiving a message with _zmq_recv()_.
 
20
 
 
21
CAUTION: Never access 'zmq_msg_t' members directly, instead always use the
 
22
_zmq_msg_ family of functions.
 
23
 
 
24
CAUTION: The functions _zmq_msg_init()_, _zmq_msg_init_data()_ and
 
25
_zmq_msg_init_size()_ are mutually exclusive. Never initialize the same
 
26
'zmq_msg_t' twice.
 
27
 
 
28
 
 
29
RETURN VALUE
 
30
------------
 
31
The _zmq_msg_init()_ function shall return zero if successful. Otherwise it
 
32
shall return `-1` and set 'errno' to one of the values defined below.
 
33
 
 
34
 
 
35
ERRORS
 
36
------
 
37
No errors are defined.
 
38
 
 
39
 
 
40
EXAMPLE
 
41
-------
 
42
.Receiving a message from a socket
 
43
----
 
44
zmq_msg_t msg;
 
45
rc = zmq_msg_init (&msg);
 
46
assert (rc == 0);
 
47
rc = zmq_recv (socket, &msg, 0);
 
48
assert (rc == 0);
 
49
----
 
50
 
 
51
 
 
52
SEE ALSO
 
53
--------
 
54
linkzmq:zmq_msg_init_size[3]
 
55
linkzmq:zmq_msg_init_data[3]
 
56
linkzmq:zmq_msg_close[3]
 
57
linkzmq:zmq_msg_data[3]
 
58
linkzmq:zmq_msg_size[3]
 
59
linkzmq:zmq[7]
 
60
 
 
61
 
 
62
AUTHORS
 
63
-------
 
64
The 0MQ documentation was written by Martin Sustrik <sustrik@250bpm.com> and
 
65
Martin Lucina <martin@lucina.net>.