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.
10 ============================================================================================
11 Man Page: rmr_set_stimeout
12 ============================================================================================
15 ============================================================================================
19 --------------------------------------------------------------------------------------------
24 --------------------------------------------------------------------------------------------
30 rmr_mbuf_t* rmr_set_stimeout( void* vctx, int rloops );
35 --------------------------------------------------------------------------------------------
37 The rmr_set_stimeout function sets the configuration for how
38 RMR will retry message send operations which complete with
39 either a *timeout* or *again* completion value. (Send
40 operations include all of the possible message send
41 functions: *rmr_send_msg(), rmr_call(), rmr_rts_msg()* and
42 *rmr_wh_send_msg().* The *rloops* parameter sets the maximum
43 number of retry loops that will be attempted before giving up
44 and returning the unsuccessful state to the user application.
45 Each retry loop is approximately 1000 attempts, and RMR does
46 **not** invoke any sleep function between retries in the
47 loop; a small, 1 mu-sec, sleep is executed between loop sets
48 if the *rloops* value is greater than 1.
52 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
54 By default, the send operations will execute with an *rloop*
55 setting of 1; each send operation will attempt to resend the
56 message approximately 1000 times before giving up. If the
57 user application does not want to have send operations retry
58 when the underlying transport mechanism indicates *timeout*
59 or *again,* the application should invoke this function and
60 pass a value of 0 (zero) for *rloops.* With this setting, all
61 RMR send operations will attempt a send operation only
62 **once,** returning immediately to the caller with the state
63 of that single attempt.
66 --------------------------------------------------------------------------------------------
68 This function returns a -1 to indicate that the *rloops*
69 value could not be set, and the value *RMR_OK* to indicate
73 --------------------------------------------------------------------------------------------
75 Currently errno is **not** set by this function; the only
76 cause of a failure is an invalid context (*vctx*) pointer.
79 --------------------------------------------------------------------------------------------
81 The following is a simple example of how the rmr_set_stimeout
88 char* port = "43086"; // port for message router listen
89 int max_size = 4096; // max message size for default allocations
90 void* mr_context; // message router context
91 mr_context = rmr_init( port, max_size, NO_FLAGS );
92 if( mr_context != NULL ) {
93 rmr_set_stimeout( mr_context, 0 ); // turn off retries
99 --------------------------------------------------------------------------------------------
101 rmr_alloc_msg(3), rmr_call(3), rmr_free_msg(3), rmr_init(3),
102 rmr_payload_size(3), rmr_rcv_msg(3), rmr_rcv_specific(3),
103 rmr_rts_msg(3), rmr_ready(3), rmr_mk_ring(3),
104 rmr_ring_free(3), rmr_send_msg(3), rmr_torcv_rcv(3),