Diffusion C API  6.5.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Sending and receiving messages as a client.

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...
 
void send_request_to_session (SESSION_T *session, SEND_REQUEST_TO_SESSION_PARAMS_T params)
 Send a request to a specific session. More...
 
void add_request_handler (SESSION_T *session, ADD_REQUEST_HANDLER_PARAMS_T params)
 Add a server registered request handler. More...
 
void send_request (SESSION_T *session, SEND_REQUEST_PARAMS_T params)
 Send a request to a path. More...
 
DIFFUSION_REQUEST_STREAM_Tset_request_stream (SESSION_T *session, const char *path, DIFFUSION_DATATYPE request_datatype, DIFFUSION_DATATYPE response_datatype, const DIFFUSION_REQUEST_STREAM_T *request_stream)
 Set a request stream to handle requests to a specified path. More...
 
DIFFUSION_REQUEST_STREAM_Tremove_request_stream (SESSION_T *session, const char *request_path)
 Remove a request stream bound to a specified path. More...
 

Detailed Description

Function Documentation

void add_request_handler ( SESSION_T session,
ADD_REQUEST_HANDLER_PARAMS_T  params 
)

Add a server registered request handler.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request handler to be added.
char* diffusion_request_context_get_path ( const DIFFUSION_REQUEST_CONTEXT_T request_context)

Return a copy of the request context's request path.

free should be called on this pointer when no longer needed.

Parameters
request_contextthe request context to retrieve the request path from.
Returns
a copy of the request context's request path. NULL, if request_context is NULL.
SESSION_ID_T* diffusion_request_context_get_session_id ( const DIFFUSION_REQUEST_CONTEXT_T request_context)

Return a copy of the request context's session ID.

session_id_free should be called on this pointer when no longer needed.

Parameters
request_contextthe request context to retrieve the session ID from.
Returns
a copy of the request context's session ID. NULL, if request_context is NULL.
HASH_T* diffusion_request_context_get_session_properties ( const DIFFUSION_REQUEST_CONTEXT_T request_context)

Return a copy of the request context's session properties.

hash_free should be called on this pointer when no longer needed.

Parameters
request_contextthe request context to retrieve session properties from.
Returns
a copy of the request context's session properties. NULL, if request_context is NULL.
DIFFUSION_REQUEST_STREAM_T* remove_request_stream ( SESSION_T session,
const char *  request_path 
)

Remove a request stream bound to a specified path.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
request_pathThe path at which to remove the request stream. If NULL, this function returns immediately.
Returns
the request stream that was removed. NULL, if there is no request stream bound to this path.
void send_request ( SESSION_T session,
SEND_REQUEST_PARAMS_T  params 
)

Send a request to a path.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to be sent.
void send_request_to_session ( SESSION_T session,
SEND_REQUEST_TO_SESSION_PARAMS_T  params 
)

Send a request to a specific session.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters defining the request to send a request to a specific session.
DIFFUSION_REQUEST_STREAM_T* set_request_stream ( SESSION_T session,
const char *  path,
DIFFUSION_DATATYPE  request_datatype,
DIFFUSION_DATATYPE  response_datatype,
const DIFFUSION_REQUEST_STREAM_T request_stream 
)

Set a request stream to handle requests to a specified path.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
pathPath to receive requests on.
request_datatypeThe request datatype.
response_datatypeThe response datatype.
request_streamRequest stream to handle requests to this path
Returns
the current REQUEST_STREAM_T at this path. NULL, if this is the first stream to be set to the path.