Diffusion C API  6.10.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Receiving data from topics.

Functions

TOPIC_HANDLER_T subscribe (SESSION_T *session, const SUBSCRIPTION_PARAMS_T params)
 Subscribe to topics. More...
 
void notify_subscription_register (SESSION_T *session, const NOTIFY_SUBSCRIPTION_PARAMS_T params)
 Register to receive subscription notifications. More...
 
void unsubscribe (SESSION_T *session, const UNSUBSCRIPTION_PARAMS_T params)
 Unsubscribe from one or more topics. More...
 
void notify_unsubscription_register (SESSION_T *session, const NOTIFY_UNSUBSCRIPTION_PARAMS_T params)
 Register to receive unsubscription notifications. More...
 
DIFFUSION_FETCH_REQUEST_Tdiffusion_fetch_request_init (SESSION_T *session)
 Creates an unconfigured fetch request. More...
 
DIFFUSION_FETCH_REQUEST_Tdiffusion_fetch_request_dup (const DIFFUSION_FETCH_REQUEST_T *fetch_request)
 Create a duplicate (copy) of an existing DIFFUSION_FETCH_REQUEST_T. More...
 
void diffusion_fetch_request_free (DIFFUSION_FETCH_REQUEST_T *fetch_request)
 Free a memory allocated DIFFUSION_FETCH_REQUEST_T More...
 

Detailed Description

Function Documentation

DIFFUSION_FETCH_REQUEST_T* diffusion_fetch_request_dup ( const DIFFUSION_FETCH_REQUEST_T fetch_request)

Create a duplicate (copy) of an existing DIFFUSION_FETCH_REQUEST_T.

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

Parameters
fetch_requestfetch request to be duplicated
Returns
a copy of the provided fetch request. NULL, if the fetch request is NULL.
void diffusion_fetch_request_free ( DIFFUSION_FETCH_REQUEST_T fetch_request)

Free a memory allocated DIFFUSION_FETCH_REQUEST_T

Parameters
fetch_requestThe fetch request to be freed
DIFFUSION_FETCH_REQUEST_T* diffusion_fetch_request_init ( SESSION_T session)

Creates an unconfigured fetch request.

Parameters
sessionThe session handle. If NULL, the function returns NULL.
Returns
a new unconfigured fetch request
void notify_subscription_register ( SESSION_T session,
const NOTIFY_SUBSCRIPTION_PARAMS_T  params 
)

Register to receive subscription notifications.

This function should be called by the application to register to receive notifications that it has been subscribed to a topic.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsCallbacks and other parameters. on_notify_subscription should be set to receive notifications.
void notify_unsubscription_register ( SESSION_T session,
const NOTIFY_UNSUBSCRIPTION_PARAMS_T  params 
)

Register to receive unsubscription notifications.

This function should be called by the application to receive notifications that it has been unsubscribed to a topic.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsCallbacks and other parameters. on_notify_unsubscription should be set to receive notifications.
TOPIC_HANDLER_T subscribe ( SESSION_T session,
const SUBSCRIPTION_PARAMS_T  params 
)

Subscribe to topics.

This function has the roles of subscribing to the topics specified by the selector and installing handlers for received TOPIC_MESSAGE_T messages which match that selector and also any other service messages related to subscription.

If a topic handler was already registered for the supplied selector, it is replaced and the old handlers are returned.

The session will become subscribed to each existing topic matching the selector unless the session is already subscribed to the topic, or the session does not have READ_TOPIC permission for the topic path. For each topic to which the session becomes subscribed, a subscription notification and initial value (if any) will be delivered to registered value streams before the completion handler is called.

The subscription request is also retained at the server and the session will be automatically subscribed to newly created topics that match the selector (unless a subsequent unsubscription cancels the request).

Parameters
sessionThe session handle. If NULL, the function returns immediately.
paramsParameters describing the subscription request and callbacks handlers which may be invoked in response.
Returns
Previous topic handler if replacing, else NULL.
void unsubscribe ( SESSION_T session,
const UNSUBSCRIPTION_PARAMS_T  params 
)

Unsubscribe from one or more topics.

This function has the roles of subscribing to the topics specified by the selector and installing handlers for received TOPIC_MESSAGE_T messages which match that selector and also any other service messages related to unsubscription.

Parameters
sessionThe session handle. If NULL, this function returns immediately.
paramsParameters describing the unsubscription request and callback handlers which may be invoked in response.