blob: 8811a73bd342651a11b3bbc23020bf3294d7d859 [file] [log] [blame]
E. Scott Daniels117030c2020-04-10 17:17:02 -04001
2
3.. This work is licensed under a Creative Commons Attribution 4.0 International License.
4.. SPDX-License-Identifier: CC-BY-4.0
5.. CAUTION: this document is generated from source in doc/src/rtd.
6.. To make changes edit the source and recompile the document.
7.. Do NOT make changes directly to .rst or .md files.
8
9
10============================================================================================
11Man Page: rmr_rcv_msg
12============================================================================================
13
14RMR Library Functions
15============================================================================================
16
17
18NAME
19--------------------------------------------------------------------------------------------
20
21rmr_rcv_msg
22
23SYNOPSIS
24--------------------------------------------------------------------------------------------
25
26
27::
28
29 #include <rmr/rmr.h>
30 rmr_mbuf_t* rmr_rcv_msg( void* vctx, rmr_mbuf_t* old_msg );
31
32
33
34DESCRIPTION
35--------------------------------------------------------------------------------------------
36
37The rmr_rcv_msg function blocks until a message is received,
38returning the message to the caller via a pointer to a
39rmr_mbuf_t structure type. If messages were queued while
40waiting for the response to a previous invocation of
41rmr_call, the oldest message is removed from the queue and
42returned without delay.
43
44The *vctx* pointer is the pointer returned by the rmr_init
45function. *Old_msg* is a pointer to a previously used message
46buffer or NULL. The ability to reuse message buffers helps to
47avoid alloc/free cycles in the user application. When no
48buffer is available to supply, the receive function will
49allocate one.
50
51RETURN VALUE
52--------------------------------------------------------------------------------------------
53
54The function returns a pointer to the rmr_mbuf_t structure
55which references the message information (state, length,
56payload), or a nil pointer in the case of an extreme error.
57
58ERRORS
59--------------------------------------------------------------------------------------------
60
61The *state* field in the message buffer will indicate RMR_OK
62when the message receive process was successful and the
63message can be used by the caller. Depending on the
64underlying transport mechanism, one of the following RMR
65error stats may be returned:
66
67
68
69RMR_ERR_EMPTY
70
71 The message received had no payload, or was completely
72 empty.
73
74
75RMR_ERR_TIMEOUT
76
77 For some transport mechanisms, or if reading the receive
78 queue from multiple threads, it is possible for one thread
79 to find no data waiting when it queries the queue. When
80 this state is reported, the message buffer does not
81 contain message data and the user application should
82 reinvoke the receive function.
83
84
85When an RMR error state is reported, the underlying errno
86value might provide more information. The following is a list
87of possible values that might accompany the states listed
88above:
89
90RMR_ERR_EMPTY if an empty message was received. If a nil
91pointer is returned, or any other state value was set in the
92message buffer, errno will be set to one of the following:
93
94
95
96INVAL
97
98 Parameter(s) passed to the function were not valid.
99
100
101EBADF
102
103 The underlying message transport is unable to process the
104 request.
105
106
107ENOTSUP
108
109 The underlying message transport is unable to process the
110 request.
111
112
113EFSM
114
115 The underlying message transport is unable to process the
116 request.
117
118
119EAGAIN
120
121 The underlying message transport is unable to process the
122 request.
123
124
125EINTR
126
127 The underlying message transport is unable to process the
128 request.
129
130
131ETIMEDOUT
132
133 The underlying message transport is unable to process the
134 request.
135
136
137ETERM
138
139 The underlying message transport is unable to process the
140 request.
141
142
143EXAMPLE
144--------------------------------------------------------------------------------------------
145
146
147SEE ALSO
148--------------------------------------------------------------------------------------------
149
150rmr_alloc_msg(3), rmr_call(3), rmr_free_msg(3),
151rmr_get_rcvfd(3), rmr_init(3), rmr_mk_ring(3),
152rmr_payload_size(3), rmr_send_msg(3), rmr_torcv_msg(3),
153rmr_rcv_specific(3), rmr_rts_msg(3), rmr_ready(3),
154rmr_ring_free(3), rmr_torcv_msg(3)