Mercury
Functions
mercury_handler.h File Reference
#include "mercury_types.h"
Include dependency graph for mercury_handler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

HG_EXPORT hg_return_t HG_Handler_process (unsigned int timeout, hg_status_t *status)
 Try timeout ms to process RPC requests. More...
 
HG_EXPORT na_addr_t HG_Handler_get_addr (hg_handle_t handle)
 Get abstract network address of remote caller from RPC handle. More...
 
HG_EXPORT na_class_tHG_Handler_get_na_class (hg_handle_t handle)
 Get NA class associated with handle. More...
 
HG_EXPORT hg_return_t HG_Handler_get_input (hg_handle_t handle, void *in_struct)
 Get input from handle (requires registration of input proc to deserialize parameters). More...
 
HG_EXPORT hg_return_t HG_Handler_free_input (hg_handle_t handle, void *in_struct)
 Free input members allocated during deserialization operation. More...
 
HG_EXPORT hg_return_t HG_Handler_start_output (hg_handle_t handle, void *out_struct)
 Start sending output from handle (requires registration of output proc to serialize parameters) This is equivalent to: More...
 
HG_EXPORT hg_return_t HG_Handler_free (hg_handle_t handle)
 Release resources allocated for handling the RPC. More...
 
HG_EXPORT hg_return_t HG_Handler_get_input_buf (hg_handle_t handle, void **in_buf, size_t *in_buf_size)
 Get RPC input buffer from handle. More...
 
HG_EXPORT hg_return_t HG_Handler_get_output_buf (hg_handle_t handle, void **out_buf, size_t *out_buf_size)
 Get RPC output buffer from handle. More...
 
HG_EXPORT hg_return_t HG_Handler_start_response (hg_handle_t handle, void *extra_out_buf, size_t extra_out_buf_size)
 Send the response back to the caller and free handle when it completes. More...
 

Function Documentation

HG_EXPORT hg_return_t HG_Handler_process ( unsigned int  timeout,
hg_status_t status 
)

Try timeout ms to process RPC requests.

Parameters
timeout[IN] timeout (in milliseconds)
status[OUT] pointer to status object
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT na_addr_t HG_Handler_get_addr ( hg_handle_t  handle)

Get abstract network address of remote caller from RPC handle.

The address gets freed when HG_Handler_free is called. Users must call NA_Addr_dup to be able to safely re-use the address.

Parameters
handle[IN] abstract RPC handle
Returns
Abstract network address
HG_EXPORT na_class_t* HG_Handler_get_na_class ( hg_handle_t  handle)

Get NA class associated with handle.

Parameters
handle[IN] abstract RPC handle
Returns
Abstract NA class
HG_EXPORT hg_return_t HG_Handler_get_input ( hg_handle_t  handle,
void *  in_struct 
)

Get input from handle (requires registration of input proc to deserialize parameters).

This is equivalent to:

  • HG_Handler_get_input_buf
  • Call hg_proc to deserialize parameters
Parameters
handle[IN] abstract RPC handle
in_struct[OUT] pointer to input structure that will be filled with deserialized input parameters of RPC call.
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Handler_free_input ( hg_handle_t  handle,
void *  in_struct 
)

Free input members allocated during deserialization operation.

HG_EXPORT hg_return_t HG_Handler_start_output ( hg_handle_t  handle,
void *  out_struct 
)

Start sending output from handle (requires registration of output proc to serialize parameters) This is equivalent to:

  • HG_Handler_get_output_buf
  • Call hg_proc to serialize parameters
  • HG_Handler_start_response
Parameters
handle[IN] abstract RPC handle
out_struct[IN] pointer to output structure that has been filled with output parameters and which will be serialized into a buffer. This buffer is then sent using a non-blocking expected send.
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Handler_free ( hg_handle_t  handle)

Release resources allocated for handling the RPC.

Parameters
handle[IN] abstract RPC handle
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Handler_get_input_buf ( hg_handle_t  handle,
void **  in_buf,
size_t *  in_buf_size 
)

Get RPC input buffer from handle.

Parameters
handle[IN] abstract RPC handle
in_buf[OUT] pointer to input buffer
in_buf_size[OUT] pointer to input buffer size
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Handler_get_output_buf ( hg_handle_t  handle,
void **  out_buf,
size_t *  out_buf_size 
)

Get RPC output buffer from handle.

Parameters
handle[IN] abstract RPC handle
out_buf[OUT] pointer to output buffer
out_buf_size[OUT] pointer to output buffer size
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t HG_Handler_start_response ( hg_handle_t  handle,
void *  extra_out_buf,
size_t  extra_out_buf_size 
)

Send the response back to the caller and free handle when it completes.

Parameters
handle[IN] abstract RPC handle
extra_out_buf[OUT] pointer to extra output buffer
extra_out_buf_size[OUT] pointer to extra output buffer size
Returns
HG_SUCCESS or corresponding HG error code