Data Structures | |
struct | example_server_operations |
Pointers to handlers for messages received from the remote system. More... | |
Functions | |
int | example_server_set_operations (struct mrpc_connection *conn, const struct example_server_operations *ops) |
Set the message handlers to be used by a connection. | |
mrpc_status_t | example_choose_color_send_async_reply (struct mrpc_message *request) |
Send an asynchronous reply to a choose_color procedure call. | |
mrpc_status_t | example_get_num_colors_send_async_reply (struct mrpc_message *request, example_count *out) |
Send an asynchronous reply to a get_num_colors procedure call. | |
mrpc_status_t | example_choose_color_send_async_reply_error (struct mrpc_message *request, mrpc_status_t status) |
Send an asynchronous error reply to a choose_color procedure call. | |
mrpc_status_t | example_get_num_colors_send_async_reply_error (struct mrpc_message *request, mrpc_status_t status) |
Send an asynchronous error reply to a get_num_colors procedure call. | |
Variables | |
struct mrpc_protocol *const | example_server |
The role definition for the example server. |
For prototypes and documentation for the server RPC handlers, see example_server_operations.
int example_server_set_operations | ( | struct mrpc_connection * | conn, | |
const struct example_server_operations * | ops | |||
) |
Set the message handlers to be used by a connection.
conn | The connection | |
ops | The operations structure to associate with the connection |
This function can be used to change the handlers which will be called when a procedure call arrives on the given connection. It must be called from the accept function, to set an initial set of handlers for an incoming connection. It can also be called at any point thereafter, including from an event handler.
The operations structure must not be modified or freed while it is associated with one or more connections.
mrpc_status_t example_choose_color_send_async_reply | ( | struct mrpc_message * | request | ) |
Send an asynchronous reply to a choose_color
procedure call.
request | The message handle originally passed to the choose_color method |
Return a MINIRPC_OK reply to the remote system for the specified request. This is used to complete a request whose handler returned MINIRPC_PENDING.
mrpc_status_t example_get_num_colors_send_async_reply | ( | struct mrpc_message * | request, | |
example_count * | out | |||
) |
Send an asynchronous reply to a get_num_colors
procedure call.
request | The message handle originally passed to the get_num_colors method | |
out | The reply structure to return |
Return a MINIRPC_OK reply and the contents of out
to the remote system for the specified request. This is used to complete a request whose handler returned MINIRPC_PENDING. out
must be allocated by the caller, and may be freed by the caller after the function returns.
mrpc_status_t example_choose_color_send_async_reply_error | ( | struct mrpc_message * | request, | |
mrpc_status_t | status | |||
) |
Send an asynchronous error reply to a choose_color
procedure call.
request | The message handle originally passed to the choose_color method | |
status | The error code to return |
Return an error reply to the remote system for the specified request. This is used to return an error for a request whose handler returned MINIRPC_PENDING.
mrpc_status_t example_get_num_colors_send_async_reply_error | ( | struct mrpc_message * | request, | |
mrpc_status_t | status | |||
) |
Send an asynchronous error reply to a get_num_colors
procedure call.
request | The message handle originally passed to the get_num_colors method | |
status | The error code to return |
Return an error reply to the remote system for the specified request. This is used to return an error for a request whose handler returned MINIRPC_PENDING.