@@ -40,7 +40,7 @@ Use this class to connect to msgpack-rpc servers and call their exposed function
40
40
| void | [wait_all_responses ](#classrpc_1_1client_1ac37437bc05b70588c079079b957eb15f )()
41
41
42
42
43
- < h4 id="classrpc_1_1client_1aafbcbb90607bb189bf75a2020ee14eb8" class="doxy" > rpc::client::client</ h4 >
43
+ #### rpc::client::client
44
44
```cpp
45
45
rpc::client::client(std::string const &addr, uint16_t port);
46
46
```
@@ -56,7 +56,7 @@ Constructs a client.
56
56
When a client is constructed, it initiates a connection asynchronically. This means that it will not block while the connection is established. However, when the first call is performed, it * might* block if the connection was not already established.
57
57
58
58
59
- < h4 id="classrpc_1_1client_1a87e0788aaa7a95dfc0e1b9c15dfe4163" class="doxy" > rpc::client::~ client</ h4 >
59
+ #### rpc::client::~ client
60
60
```cpp
61
61
rpc::client::~ client();
62
62
```
@@ -67,7 +67,7 @@ Destructor.
67
67
During destruction, the connection to the server is gracefully closed. This means that any outstanding reads and writes are completed first.
68
68
69
69
70
- < h4 id="classrpc_1_1client_1aedc166b5a80820be198ef134f522b049" class="doxy" > rpc::client::call</ h4 >
70
+ #### rpc::client::call
71
71
```cpp
72
72
RPCLIB_MSGPACK::object_handle rpc::client::call(std::string const &func_name, Args... args);
73
73
```
@@ -86,7 +86,7 @@ Calls a function with the given name and arguments (if any).
86
86
A RPCLIB_MSGPACK::object containing the result of the function (if any). To obtain a typed value, use the msgpack API.
87
87
88
88
89
- < h4 id="classrpc_1_1client_1a2e3702a314c8c0a00bfac652b82d16cc" class="doxy" > rpc::client::async_call</ h4 >
89
+ #### rpc::client::async_call
90
90
```cpp
91
91
std::future< RPCLIB_MSGPACK::object_handle > rpc::client::async_call(std::string const &func_name, Args... args);
92
92
```
@@ -108,7 +108,7 @@ A call is performed asynchronously in the context of the client, i.e. this is no
108
108
A std::future, possibly holding a future result (which is a RPCLIB_MSGPACK::object).
109
109
110
110
111
- < h4 id="classrpc_1_1client_1a5f5ad1d1d0630178a51ae219cd831b44" class="doxy" > rpc::client::send</ h4 >
111
+ #### rpc::client::send
112
112
```cpp
113
113
void rpc::client::send(std::string const &func_name, Args... args);
114
114
```
@@ -129,7 +129,7 @@ Notifications are a special kind of calls. They can be used to notify the server
129
129
!!! warn
130
130
This function returns immediately (possibly before the notification is written to the socket).
131
131
132
- < h4 id="classrpc_1_1client_1a2c264af4d7169574452b9f968ffde87d" class="doxy" > rpc::client::get_timeout</ h4 >
132
+ #### rpc::client::get_timeout
133
133
```cpp
134
134
nonstd:: optional < int64_t > rpc::client::get_timeout() const;
135
135
```
@@ -142,31 +142,31 @@ The timeout is applied to synchronous calls. If the timeout expires without rece
142
142
!!! warn
143
143
The timeout has no effect on async calls. For those, the preferred timeout mechanism remains using std::future.
144
144
145
- < h4 id="classrpc_1_1client_1af890e3067745861642e2ba1a65bebce6" class="doxy" > rpc::client::set_timeout</ h4 >
145
+ #### rpc::client::set_timeout
146
146
```cpp
147
147
void rpc::client::set_timeout(int64_t value);
148
148
```
149
149
150
150
Sets the timeout for synchronous calls. For more information, see
151
151
152
152
153
- < h4 id="classrpc_1_1client_1a89eeffaf87bf0470a65c9c8ca40562bb" class="doxy" > rpc::client::clear_timeout</ h4 >
153
+ #### rpc::client::clear_timeout
154
154
```cpp
155
155
void rpc::client::clear_timeout();
156
156
```
157
157
158
158
Clears the timeout for synchronous calls. For more information, see
159
159
160
160
161
- < h4 id="classrpc_1_1client_1a710037bce0d9b80127a98eb6cd54caf1" class="doxy" > rpc::client::get_connection_state</ h4 >
161
+ #### rpc::client::get_connection_state
162
162
```cpp
163
163
connection_state rpc::client::get_connection_state() const;
164
164
```
165
165
166
166
Returns the current connection state.
167
167
168
168
169
- < h4 id="classrpc_1_1client_1ac37437bc05b70588c079079b957eb15f" class="doxy" > rpc::client::wait_all_responses</ h4 >
169
+ #### rpc::client::wait_all_responses
170
170
```cpp
171
171
void rpc::client::wait_all_responses();
172
172
```
@@ -194,15 +194,15 @@ This type allows clients to handle arbitrary error objects as the msgpack-rpc sp
194
194
| RPCLIB_MSGPACK::object_handle & | [get_error ](#classrpc_1_1rpc__error_1a88ab8f211393ae62813042a797c08663 )()
195
195
196
196
197
- < h4 id="classrpc_1_1rpc__error_1ac45388bcde0a436b888c907015df01e2" class="doxy" > rpc::rpc_error::get_function_name</ h4 >
197
+ #### rpc::rpc_error::get_function_name
198
198
```cpp
199
199
std::string rpc::rpc_error::get_function_name() const;
200
200
```
201
201
202
202
Returns the name of the function that was called on the server while the error occurred.
203
203
204
204
205
- < h4 id="classrpc_1_1rpc__error_1a88ab8f211393ae62813042a797c08663" class="doxy" > rpc::rpc_error::get_error</ h4 >
205
+ #### rpc::rpc_error::get_error
206
206
```cpp
207
207
RPCLIB_MSGPACK::object_handle & rpc::rpc_error::get_error();
208
208
```
@@ -239,7 +239,7 @@ The server maintains a registry of function bindings that it uses to dispatch ca
239
239
| void | [close_sessions ](#classrpc_1_1server_1abf6bebbbeea52451aef2126d29240094 )()
240
240
241
241
242
- < h4 id="classrpc_1_1server_1ac406b44f73cf2ff17240c0cd926a9c1e" class="doxy" > rpc::server::server</ h4 >
242
+ #### rpc::server::server
243
243
```cpp
244
244
rpc::server::server(uint16_t port);
245
245
```
@@ -250,7 +250,7 @@ Constructs a server that listens on the localhost on the specified port.
250
250
`port` The port number to listen on.
251
251
252
252
253
- < h4 id="classrpc_1_1server_1a744b961d3b151b3449a4e0da37bd471a" class="doxy" > rpc::server::server</ h4 >
253
+ #### rpc::server::server
254
254
```cpp
255
255
rpc::server::server(server &&other) noexcept;
256
256
```
@@ -261,7 +261,7 @@ Move constructor. This is implemented by calling the move assignment operator.
261
261
`other` The other instance to move from.
262
262
263
263
264
- < h4 id="classrpc_1_1server_1ad71ffce076d752e116cefa3672e5d188" class="doxy" > rpc::server::server</ h4 >
264
+ #### rpc::server::server
265
265
```cpp
266
266
rpc::server::server(std::string const &address , uint16_t port);
267
267
```
@@ -274,7 +274,7 @@ Constructs a server that listens on the specified address on the specified port.
274
274
`port` The port number to listen on.
275
275
276
276
277
- < h4 id="classrpc_1_1server_1a20b9197e5ef1a22371e6fbdb7f58b330" class="doxy" > rpc::server::~ server</ h4 >
277
+ #### rpc::server::~ server
278
278
```cpp
279
279
rpc::server::~ server();
280
280
```
@@ -285,7 +285,7 @@ Destructor.
285
285
When the server is destroyed, all ongoin sessions are closed gracefully.
286
286
287
287
288
- < h4 id="classrpc_1_1server_1ac3cf4848fc3969cd26ba5e3bd2dc411b" class="doxy" > rpc::server::operator=</ h4 >
288
+ #### rpc::server::operator=
289
289
```cpp
290
290
server rpc::server::operator=(server &&other);
291
291
```
@@ -299,7 +299,7 @@ Move assignment operator.
299
299
The result of the assignment.
300
300
301
301
302
- < h4 id="classrpc_1_1server_1a981d7e4a08d04d05cbac6770fab0dff8" class="doxy" > rpc::server::run</ h4 >
302
+ #### rpc::server::run
303
303
```cpp
304
304
void rpc::server::run();
305
305
```
@@ -310,7 +310,7 @@ Starts the server loop. This is a blocking call.
310
310
First and foremost, running the event loop causes the server to start listening on the specified port. Also, as connections are established and calls are made by clients, the server executes the calls as part of this call. This means that the handlers are executed on the thread that calls `run`. Reads and writes are initiated by this function internally as well.
311
311
312
312
313
- < h4 id="classrpc_1_1server_1a462e032fa21cad78eeacc27da103a2b7" class="doxy" > rpc::server::async_run</ h4 >
313
+ #### rpc::server::async_run
314
314
```cpp
315
315
void rpc::server::async_run(std::size_t worker_threads=1);
316
316
```
@@ -324,7 +324,7 @@ Starts the server loop on one or more threads. This is a non-blocking call.
324
324
This function behaves similarly to `run`, except the event loop is optionally started on different threads. Effectively this sets up a worker thread pool for the server. Handlers will be executed on one of the threads.
325
325
326
326
327
- < h4 id="classrpc_1_1server_1a072135629430df6d5576416806f7b02c" class="doxy" > rpc::server::bind</ h4 >
327
+ #### rpc::server::bind
328
328
```cpp
329
329
void rpc::server::bind(std::string const &name, F func);
330
330
```
@@ -343,7 +343,7 @@ Binds a functor to a name so it becomes callable via RPC.
343
343
This function template accepts a wide range of callables. The arguments and return types of these callables should be serializable by msgpack. `bind` effectively generates a suitable, light-weight compile-time wrapper for the functor.
344
344
345
345
346
- < h4 id="classrpc_1_1server_1a95d336322c9c24cf014404a3b4f70df5" class="doxy" > rpc::server::suppress_exceptions</ h4 >
346
+ #### rpc::server::suppress_exceptions
347
347
```cpp
348
348
void rpc::server::suppress_exceptions(bool suppress);
349
349
```
@@ -353,7 +353,7 @@ Sets the exception behavior in handlers. By default, handlers throwing will cras
353
353
!!! warn
354
354
Setting this flag only affects subsequent connections.
355
355
356
- < h4 id="classrpc_1_1server_1a7df94a496caf38b3d679113c1f62082b" class="doxy" > rpc::server::stop</ h4 >
356
+ #### rpc::server::stop
357
357
```cpp
358
358
void rpc::server::stop();
359
359
```
@@ -363,7 +363,7 @@ Stops the server.
363
363
!!! warn
364
364
This should not be called from worker threads.
365
365
366
- < h4 id="classrpc_1_1server_1abf6bebbbeea52451aef2126d29240094" class="doxy" > rpc::server::close_sessions</ h4 >
366
+ #### rpc::server::close_sessions
367
367
```cpp
368
368
void rpc::server::close_sessions();
369
369
```
@@ -394,7 +394,7 @@ Encapsulates information about the currently executing handler. This is the inte
394
394
| void | [clear ](#classrpc_1_1this__handler__t_1a0a53e27b4d8d5b542790b218029d26f4 )()
395
395
396
396
397
- < h4 id="classrpc_1_1this__handler__t_1a6cfb57fa89c28bd49c6ec82c42c32e87" class="doxy" > rpc::this_handler_t::respond_error</ h4 >
397
+ #### rpc::this_handler_t::respond_error
398
398
```cpp
399
399
void rpc::this_handler_t::respond_error(T &&err_obj);
400
400
```
@@ -408,7 +408,7 @@ Sets an arbitrary object to be sent back as an error response to the client.
408
408
`err_obj` The error object . This can be anything that is possible to encode with messagepack (even custom structures).
409
409
410
410
411
- < h4 id="classrpc_1_1this__handler__t_1ab825539a615b55772ebc1513cf2b44c7" class="doxy" > rpc::this_handler_t::respond</ h4 >
411
+ #### rpc::this_handler_t::respond
412
412
```cpp
413
413
void rpc::this_handler_t::respond(T &&resp_obj);
414
414
```
@@ -424,7 +424,7 @@ Sets an arbitrary object to be sent back as the response to the call.
424
424
!!! warn
425
425
The normal return value of the function (if any) will be ignored if a special response is set .
426
426
427
- < h4 id="classrpc_1_1this__handler__t_1a179997ea536a93f1b8054e0a480876a5" class="doxy" > rpc::this_handler_t::disable_response</ h4 >
427
+ #### rpc::this_handler_t::disable_response
428
428
```cpp
429
429
void rpc::this_handler_t::disable_response();
430
430
```
@@ -434,15 +434,15 @@ Instructs the server to not send a response to the client (ignoring any errors a
434
434
!!! warn
435
435
It is unusual to not send a response to requests, and doing so might cause problems in the client (depending on its implementation).
436
436
437
- < h4 id="classrpc_1_1this__handler__t_1aac9c17130dea7ded4bf020a370a0b9aa" class="doxy" > rpc::this_handler_t::enable_response</ h4 >
437
+ #### rpc::this_handler_t::enable_response
438
438
```cpp
439
439
void rpc::this_handler_t::enable_response();
440
440
```
441
441
442
442
Enables sending a response to the call. Sending the response is by default enabled. Enabling the response multiple times have no effect.
443
443
444
444
445
- < h4 id="classrpc_1_1this__handler__t_1a0a53e27b4d8d5b542790b218029d26f4" class="doxy" > rpc::this_handler_t::clear</ h4 >
445
+ #### rpc::this_handler_t::clear
446
446
```cpp
447
447
void rpc::this_handler_t::clear();
448
448
```
@@ -470,15 +470,15 @@ Allows controlling the server instance from the currently executing handler.
470
470
| void | [cancel_stop ](#classrpc_1_1this__server__t_1a127035c6f2281a5a1bfadf19f4dfe451 )()
471
471
472
472
473
- < h4 id="classrpc_1_1this__server__t_1a7e522ccc489d7376e2d795f030f3890f" class="doxy" > rpc::this_server_t::stop</ h4 >
473
+ #### rpc::this_server_t::stop
474
474
```cpp
475
475
void rpc::this_server_t::stop();
476
476
```
477
477
478
478
Gracefully stops the server.
479
479
480
480
481
- < h4 id="classrpc_1_1this__server__t_1a127035c6f2281a5a1bfadf19f4dfe451" class="doxy" > rpc::this_server_t::cancel_stop</ h4 >
481
+ #### rpc::this_server_t::cancel_stop
482
482
```cpp
483
483
void rpc::this_server_t::cancel_stop();
484
484
```
@@ -506,7 +506,7 @@ Encapsulates information about the server session/connection this handler is run
506
506
| session_id_t | [id ](#classrpc_1_1this__session__t_1aada2250ec9dd3d88781ca16eb4352047 )() const
507
507
508
508
509
- < h4 id="classrpc_1_1this__session__t_1ae0551bc44674bdd43e33a4d4a36781b0" class="doxy" > rpc::this_session_t::post_exit</ h4 >
509
+ #### rpc::this_session_t::post_exit
510
510
```cpp
511
511
void rpc::this_session_t::post_exit();
512
512
```
@@ -516,7 +516,7 @@ Gracefully exits the session (i.e. ongoing writes and reads are completed; queue
516
516
!!! warn
517
517
Use this function if you need to close the connection from a handler.
518
518
519
- < h4 id="classrpc_1_1this__session__t_1aada2250ec9dd3d88781ca16eb4352047" class="doxy" > rpc::this_session_t::id</ h4 >
519
+ #### rpc::this_session_t::id
520
520
```cpp
521
521
session_id_t rpc::this_session_t::id() const;
522
522
```
@@ -545,7 +545,7 @@ This exception is thrown by the client when either the connection or a call take
545
545
| const char * | [what ](#classrpc_1_1timeout_1ad782f083798c650188b5927a226c3b04 )() const noexcept override
546
546
547
547
548
- < h4 id="classrpc_1_1timeout_1ad782f083798c650188b5927a226c3b04" class="doxy" > rpc::timeout::what</ h4 >
548
+ #### rpc::timeout::what
549
549
```cpp
550
550
const char * rpc::timeout::what() const noexcept override;
551
551
```
0 commit comments