Diffusion C API  6.7.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
responder.h File Reference

Functions for working with DIFFUSION_RESPONDER_HANDLE_T to either respond or reject requests. More...

Typedefs

typedef struct
DIFFUSION_RESPONDER_HANDLE_T 
DIFFUSION_RESPONDER_HANDLE_T
 A handle dispatched on receiving a request. More...
 

Functions

bool diffusion_responder_get_response_datatype (const DIFFUSION_RESPONDER_HANDLE_T *handle, DIFFUSION_DATATYPE *response_datatype, DIFFUSION_API_ERROR *error)
 Retrieve the responder handle's response datatype. More...
 
bool diffusion_respond_to_request (SESSION_T *session, const DIFFUSION_RESPONDER_HANDLE_T *handle, BUF_T *response, DIFFUSION_API_ERROR *error)
 Respond to a request. More...
 
bool diffusion_reject_request (SESSION_T *session, const DIFFUSION_RESPONDER_HANDLE_T *handle, const char *message, DIFFUSION_API_ERROR *error)
 Reject a request. More...
 
DIFFUSION_RESPONDER_HANDLE_Tdiffusion_responder_handle_dup (const DIFFUSION_RESPONDER_HANDLE_T *handle)
 Create a duplicate (copy) of an existing DIFFUSION_RESPONDER_HANDLE_T. More...
 
void diffusion_responder_handle_free (DIFFUSION_RESPONDER_HANDLE_T *handle)
 Free memory associated with a DIFFUSION_RESPONDER_HANDLE_T More...
 

Detailed Description

Functions for working with DIFFUSION_RESPONDER_HANDLE_T to either respond or reject requests.

Copyright © 2018, 2021 Push Technology Ltd., All Rights Reserved.

Use is subject to license terms.

NOTICE: All information contained herein is, and remains the property of Push Technology. The intellectual and technical concepts contained herein are proprietary to Push Technology and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret or copyright law.

Typedef Documentation

A handle dispatched on receiving a request.

Each request received has its own unique handle. This handle is required to respond to a request with the function diffusion_respond_to_request or reject a request with diffusion_reject_request.

Function Documentation

bool diffusion_reject_request ( SESSION_T session,
const DIFFUSION_RESPONDER_HANDLE_T handle,
const char *  message,
DIFFUSION_API_ERROR error 
)

Reject a request.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
handleThe response handle used when dispatching a response.
messageContext message to be contained in the rejection. Can be NULL.
errorPopulated if an error occurs. Can be NULL.
Returns
true if the response was successfully rejected. False, otherwise. In this case, if a non-NULL DIFFUSION_API_ERROR pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_respond_to_request ( SESSION_T session,
const DIFFUSION_RESPONDER_HANDLE_T handle,
BUF_T response,
DIFFUSION_API_ERROR error 
)

Respond to a request.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
handleThe response handle used when dispatching a response.
responseThe response to be sent.
errorPopulated if an error occurs. Can be NULL.
Returns
true if the response was successfully dispatched. False, otherwise. In this case, if a non-NULL DIFFUSION_API_ERROR pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_responder_get_response_datatype ( const DIFFUSION_RESPONDER_HANDLE_T handle,
DIFFUSION_DATATYPE response_datatype,
DIFFUSION_API_ERROR error 
)

Retrieve the responder handle's response datatype.

Parameters
handleThe response handle used when dispatching a response.
response_datatypeA pointer to a DIFFUSION_DATATYPE which will have its value set to the responder's response datatype.
errorPopulated if an error occurs. Can be NULL.
Returns
true if the response datatype was successfully retrieved. False, otherwise. In this case, if a non-NULL DIFFUSION_API_ERROR pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
DIFFUSION_RESPONDER_HANDLE_T* diffusion_responder_handle_dup ( const DIFFUSION_RESPONDER_HANDLE_T handle)

Create a duplicate (copy) of an existing DIFFUSION_RESPONDER_HANDLE_T.

diffusion_responder_handle_free should be called on the pointer when longer needed.

Parameters
handleThe responder handle to be duplicated.
Returns
a copy of the provided responder handle. NULL, if the provided handle is NULL.
void diffusion_responder_handle_free ( DIFFUSION_RESPONDER_HANDLE_T handle)

Free memory associated with a DIFFUSION_RESPONDER_HANDLE_T

Parameters
handleThe responder handle to be freed.