Diffusion C API  6.3.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
messaging-control.h File Reference

Messaging control feature. More...

Data Structures

struct  send_msg_to_session_params_s
 
struct  svc_send_to_filter_response_s
 
struct  send_msg_to_filter_params_s
 
struct  svc_send_receiver_client_request_s
 Structure containing the information received and passed to a handler registered on a message path, including the message content. More...
 
struct  msg_receiver_registration_params_s
 Structure supplied when issuing a register_msg_handler() call. More...
 
struct  send_request_to_session_params_s
 Structure supplied when issuing a send_request_to_session() call. More...
 
struct  diffusion_request_handler_s
 Request handler structure required when creating an ADD_REQUEST_HANDLER_PARAMS_T More...
 
struct  add_request_handler_params_s
 Structure supplied when issuing a add_request_handler() call. More...
 
struct  send_request_to_filter_params_s
 Structure supplied when issuing a send_request_to_filter() call. More...
 

Macros

#define MSG_RECEIVER_REGISTRATION_HANDLERS
 Handlers for notification of registration of handler and message receipt.
 

Typedefs

typedef struct
DIFFUSION_REQUEST_CONTEXT_T 
DIFFUSION_REQUEST_CONTEXT_T
 Context information of the request received. More...
 
typedef struct
svc_send_receiver_client_request_s 
SVC_SEND_RECEIVER_CLIENT_REQUEST_T
 Structure containing the information received and passed to a handler registered on a message path, including the message content.
 
typedef int(* on_msg_receiver_registration_cb )(SESSION_T *session, void *context)
 Callback when a handler is registered with the server. More...
 
typedef int(* on_send_receiver_client_msg_cb )(SESSION_T *session, const SVC_SEND_RECEIVER_CLIENT_REQUEST_T *request, void *context)
 Callback when a message is received by a registered handler on a message path. More...
 
typedef struct
msg_receiver_registration_params_s 
MSG_RECEIVER_REGISTRATION_PARAMS_T
 Structure supplied when issuing a register_msg_handler() call.
 
typedef int(* request_on_response_cb )(DIFFUSION_DATATYPE response_datatype, const DIFFUSION_VALUE_T *response, void *context)
 Callback when a response to a request is received. More...
 
typedef struct
send_request_to_session_params_s 
SEND_REQUEST_TO_SESSION_PARAMS_T
 Structure supplied when issuing a send_request_to_session() call.
 
typedef int(* request_handler_on_request )(SESSION_T *session, DIFFUSION_DATATYPE request_datatype, const DIFFUSION_VALUE_T *request, const DIFFUSION_REQUEST_CONTEXT_T *request_context, const DIFFUSION_RESPONDER_HANDLE_T *handle, void *context)
 Callback when a request to a request handler has been received. More...
 
typedef int(* request_handler_on_active )(SESSION_T *session, const char *path, const DIFFUSION_REGISTRATION_T *registered_handler)
 Callback when a request handler is active. More...
 
typedef void(* request_handler_on_close )(void)
 Callback when a request handler is closed.
 
typedef int(* request_handler_on_error )(const DIFFUSION_ERROR_T *error)
 Callback when a request handler has encountered an error. More...
 
typedef struct
diffusion_request_handler_s 
DIFFUSION_REQUEST_HANDLER_T
 Request handler structure required when creating an ADD_REQUEST_HANDLER_PARAMS_T
 
typedef struct
add_request_handler_params_s 
ADD_REQUEST_HANDLER_PARAMS_T
 Structure supplied when issuing a add_request_handler() call.
 
typedef int(* filtered_request_number_sent )(int number_sent, void *context)
 Callback when a filtered request has been dispatched to a number of sessions. More...
 
typedef int(* filtered_request_on_response )(DIFFUSION_DATATYPE response_datatype, const DIFFUSION_VALUE_T *response, void *context)
 Callback when a response to a filtered request has been received. More...
 
typedef int(* filtered_request_on_response_error )(const SESSION_ID_T *session_id, const DIFFUSION_ERROR_T *error)
 Callback when a response results in an error. More...
 
typedef struct
send_request_to_filter_params_s 
SEND_REQUEST_TO_FILTER_PARAMS_T
 Structure supplied when issuing a send_request_to_filter() call.
 

Functions

SESSION_ID_Tdiffusion_request_context_get_session_id (const DIFFUSION_REQUEST_CONTEXT_T *request_context)
 Return a copy of the request context's session ID. More...
 
char * diffusion_request_context_get_path (const DIFFUSION_REQUEST_CONTEXT_T *request_context)
 Return a copy of the request context's request path. More...
 
HASH_Tdiffusion_request_context_get_session_properties (const DIFFUSION_REQUEST_CONTEXT_T *request_context)
 Return a copy of the request context's session properties. More...
 
 DEPRECATED (void send_msg_to_session(SESSION_T *session, SEND_MSG_TO_SESSION_PARAMS_T params))
 Send a message to a specific session. More...
 
void send_request_to_session (SESSION_T *session, SEND_REQUEST_TO_SESSION_PARAMS_T params)
 Send a request to a specific session. More...
 
 DEPRECATED (void send_msg_to_filter(SESSION_T *session, SEND_MSG_TO_FILTER_PARAMS_T params))
 Send a message via a filter. More...
 
void send_request_to_filter (SESSION_T *session, SEND_REQUEST_TO_FILTER_PARAMS_T params)
 Send a request via a filter. More...
 
void add_request_handler (SESSION_T *session, ADD_REQUEST_HANDLER_PARAMS_T params)
 Add a server registered request handler. More...
 
 DEPRECATED (void register_msg_handler(SESSION_T *session, const MSG_RECEIVER_REGISTRATION_PARAMS_T params))
 Register a message handler. More...
 

Detailed Description

Messaging control feature.

Typedef Documentation

Context information of the request received.

Request path, session ID and session properties

typedef int(* filtered_request_number_sent)(int number_sent, void *context)

Callback when a filtered request has been dispatched to a number of sessions.

Parameters
number_sentThe number of requests sent to sessions.
contextUser supplied context passed in from SEND_REQUEST_TO_FILTER_PARAMS_T.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* filtered_request_on_response)(DIFFUSION_DATATYPE response_datatype, const DIFFUSION_VALUE_T *response, void *context)

Callback when a response to a filtered request has been received.

Parameters
response_datatypeDatatype of the response.
responseResponse as a DIFFUSION_VALUE_T.
contextUser supplied context passed in from SEND_REQUEST_TO_FILTER_PARAMS_T.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* filtered_request_on_response_error)(const SESSION_ID_T *session_id, const DIFFUSION_ERROR_T *error)

Callback when a response results in an error.

Parameters
session_idThe session id of the session which responded with an error.
errorThe response error. The context will be the user supplied context passed in from SEND_REQUEST_TO_FILTER_PARAMS_T.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* on_msg_receiver_registration_cb)(SESSION_T *session, void *context)

Callback when a handler is registered with the server.

Parameters
sessionThe currently active session.
contextUser-supplied context from the initial register_msg_handler() call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* on_send_receiver_client_msg_cb)(SESSION_T *session, const SVC_SEND_RECEIVER_CLIENT_REQUEST_T *request, void *context)

Callback when a message is received by a registered handler on a message path.

Parameters
sessionThe currently active session.
requestDetails about the incoming message, and the message itself.
contextUser-supplied context from the initial register_msg_handler() call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* request_handler_on_active)(SESSION_T *session, const char *path, const DIFFUSION_REGISTRATION_T *registered_handler)

Callback when a request handler is active.

Parameters
sessionThe currently active session.
pathThe path request handler is bound to.
registered_handlerThe registered handler
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* request_handler_on_error)(const DIFFUSION_ERROR_T *error)

Callback when a request handler has encountered an error.

Parameters
errorThe received error.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* request_handler_on_request)(SESSION_T *session, DIFFUSION_DATATYPE request_datatype, const DIFFUSION_VALUE_T *request, const DIFFUSION_REQUEST_CONTEXT_T *request_context, const DIFFUSION_RESPONDER_HANDLE_T *handle, void *context)

Callback when a request to a request handler has been received.

Parameters
sessionThe currently active session.
request_datatypeThe request datatype.
requestThe request.
request_contextThe request context.
handleThe responder handle. Used when a response is dispatched with respond_to_request.
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* request_on_response_cb)(DIFFUSION_DATATYPE response_datatype, const DIFFUSION_VALUE_T *response, void *context)

Callback when a response to a request is received.

Parameters
response_datatypeDatatype of the response.
responseResponse as a DIFFUSION_VALUE_T.
contextUser supplied context passed in from SEND_REQUEST_TO_SESSION_PARAMS_T.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

Function Documentation

DEPRECATED ( void   send_msg_to_sessionSESSION_T *session, SEND_MSG_TO_SESSION_PARAMS_T params)

Send a message to a specific session.

Deprecated:
This function is deprecated from version 6.2 onwards, and will be removed in a future release.
Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to send a message to a specific session.
DEPRECATED ( void   send_msg_to_filterSESSION_T *session, SEND_MSG_TO_FILTER_PARAMS_T params)

Send a message via a filter.

Deprecated:
This function is deprecated from version 6.2 onwards, and will be removed in a future release.
Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to send a message via a filter.
DEPRECATED ( void   register_msg_handlerSESSION_T *session, const MSG_RECEIVER_REGISTRATION_PARAMS_T params)

Register a message handler.

Deregister a message handler.

Deprecated:
This function is deprecated from version 6.2 onwards, and will be removed in a future release.

Message handlers receive messages which are sent from clients via paths. Only one handler for a particular path may be active at any one time, as determined by the server.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to register a message handler.
Deprecated:
This function is deprecated from version 6.2 onwards, and will be removed in a future release.
Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsThe same parameters passed when registering the message handler.
void send_request_to_filter ( SESSION_T session,
SEND_REQUEST_TO_FILTER_PARAMS_T  params 
)

Send a request via a filter.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to send a request via a filter.