example_server_operations Struct Reference
[Server Stubs]


Detailed Description

Pointers to handlers for messages received from the remote system.

If a message's handler is set to NULL, the message will be dropped and (if possible) MINIRPC_PROCEDURE_UNAVAIL will be returned to the sender.

See also:
example_server_set_operations()

Data Fields

mrpc_status_t(* choose_color )(void *conn_data, struct mrpc_message *msg, example_color_choice *in)
 Handler for choose_color procedure.
mrpc_status_t(* get_num_colors )(void *conn_data, struct mrpc_message *msg, example_count *out)
 Handler for get_num_colors procedure.
void(* crayon_selected )(void *conn_data, struct mrpc_message *msg, example_color *in)
 Handler for crayon_selected message.

Field Documentation

mrpc_status_t(* choose_color)(void *conn_data, struct mrpc_message *msg, example_color_choice *in)

Handler for choose_color procedure.

Parameters:
conn_data The cookie for the originating connection
msg An opaque handle to the request message
in The procedure parameter received from the remote system
Returns:
An error code, 0 for success, or MINIRPC_PENDING to defer the reply
If this function returns a result other than MINIRPC_PENDING, that result will be returned to the remote system immediately. If the handler returns MINIRPC_PENDING, no immediate reply will be made; the application can then call example_choose_color_send_async_reply() at its convenience to return MINIRPC_OK to the remote system, or example_choose_color_send_async_reply_error() to return a non-zero error code.

in will be freed by miniRPC once the handler returns. This will occur whether or not the handler returns MINIRPC_PENDING.

mrpc_status_t(* get_num_colors)(void *conn_data, struct mrpc_message *msg, example_count *out)

Handler for get_num_colors procedure.

Parameters:
conn_data The cookie for the originating connection
msg An opaque handle to the request message
[out] out The procedure parameter to be returned to the remote system
Returns:
An error code, 0 for success, or MINIRPC_PENDING to defer the reply
If this function returns MINIRPC_OK, that status code and the contents of out will be returned to the remote system immediately. If it returns a non-zero error code other than MINIRPC_PENDING, that status code will be returned to the remote system and the contents of out will be discarded. If it returns MINIRPC_PENDING, no immediate reply will be made. At its convenience, the application can then call example_get_num_colors_send_async_reply() to return MINIRPC_OK and an example_count structure, or example_get_num_colors_send_async_reply_error() to return an error code.

out is pre-allocated and should be filled in by the handler. It will be freed once the handler returns, even if the handler returns MINIRPC_PENDING; the application will need to allocate its own example_count if it later wants to send an asynchronous reply.

void(* crayon_selected)(void *conn_data, struct mrpc_message *msg, example_color *in)

Handler for crayon_selected message.

Parameters:
conn_data The cookie for the originating connection
msg An opaque handle to the request message
in The procedure parameter received from the remote system
This is a handler for a message declared in the "msgs" section of the protocol definition file; it does not return any information to the remote system. in will be freed once the handler returns.


miniRPC 0.3.3
Documentation generated by Doxygen 1.5.6