VDSF
Menu

API functions for vdsf processes.


Functions

VDSF_EXPORT void vdsExit ()
 This function terminates all access to the VDS.
VDSF_EXPORT int vdsInit (const char *wdAddress, int protectionNeeded)
 This function initializes access to a VDS.


Function Documentation

VDSF_EXPORT void vdsExit (  ) 

This function terminates all access to the VDS.

This function will also close all sessions and terminate all accesses to the different objects.

This function takes no argument and always end successfully (even if called twice or if vdsInit was not called).

VDSF_EXPORT int vdsInit ( const char *  wdAddress,
int  protectionNeeded 
)

This function initializes access to a VDS.

It takes 2 input arguments, the address of the watchdog and an integer (used as a boolean, 0 for false, 1 for true) to indicate if sessions and other objects (Queues, etc) are shared amongst threads (in the current process) and must be protected. Recommendation: always set protectionNeeded to 0 (false) unless you cannot do otherwise. In other words it is recommended to use one session handle for each thread. Also if the same queue needs to be accessed by two threads it is more efficient to have two different handles instead of sharing a single one.

[Additional note: API objects (or C handles) are just proxies for the real objects sitting in shared memory. Proper synchronization is already done in shared memory and it is best to avoid to synchronize these proxy objects.]

Upon successful completion, the process handle is set. Otherwise the error code is returned.

Parameters:
[in] wdAddress The address of the watchdog. Currently a string with the port number ("12345").
[in] protectionNeeded A boolean value indicating if multi-threaded locks are needed or not.
Returns:
0 on success or a vdsErrors on error.

Last updated on April 07, 2008.