sk_registerAsRedundantApp() / sk_deregisterAsRedundantApp()

Description

Use the function sk_registerAsRedundantApp() when an application wants to register as a member of a RAP. The function then uses the SK_RegisterAsRedundantApp message to process the request. An application can also use this function for parameter changes of a previous registration.

Registering by calling the function instead of directly sending the API message guarantees that the message is resent if the application should lose its connection with the LLC.

This message is also available as sk_registerAsRedundantAppOnConnection() and skts_registerAsRedundantApp().

To de-register, the application must issue sk_deregisterAsRedundantApp(). This function also uses the SK_RegisterAsRedundantApp message for the de-registration, but the RedundantAppPriority argument is hard coded to -1 in order to remove the application from the RAP. This message is also available as sk_deregisterAsRedundantAppOnConnection() and skts_deregisterAsRedundantApp().

The application must be able to handle the acknowledgments for a registration and de-registration.

Syntax

int sk_registerAsRedundantApp(int anAppID, const char *aRedundantAppPoolID, int aRedundantAppPriority, int aDataSize, const UBYTE *aDataBuf, void *aTag, HandlerFunc *aHandlerFunc);

int sk_deregisterAsRedundantApp(int anAppID, const char *aRedundantAppPoolID, void *aTag, HandlerFunc *aHandlerFunc);

int sk_registerAsRedundantAppOnConnection(int anAppID, const char *aRedundantAppPoolID, int aRedundantAppPriority, int aDataSize, const UBYTE *aDataBuf, void *aTag, HandlerFunc *aHandlerFunc, int conID);

int sk_deregisterAsRedundantAppOnConnection(int anAppID, const char *aRedundantAppPoolID,void *aTag, HandlerFunc *aHandlerFunc, int conID);

Threadsafe Syntax

int skts_registerAsRedundantApp( int anAppID, const char *aRedundantAppPoolID, int aRedundantAppPriority, int aDataSize, const UBYTE *aDataBuf, void *aTag, HandlerFunc *aHandlerFunc, int aConID );

int skts_deregisterAsRedundantApp( int anAppID, const char *aRedundantAppPoolID, void *aTag, HandlerFunc *aHandlerFunc, int aConID );

Parameters

The function parameters are shown in the table below.

Parameter

Description

anAppID

The application identifier assigned by the LLC to the application. The name can be obtained by calling sk_getConnectionName().

aRedundantAppPoolID

A string that uniquely identifies the class of application wishing to be treated as redundant applications.

Note: The ID is case sensitive.

aRedundantAppPriority

RedundantAppPriority is a value indicating the current priority of the application. The higher the value, the more likely it is that the LLC will select the application as primary. Special values are:

SK_RED_APP_PRI_MONITOR (0)
Used by an application wishing to monitor the activity of this RedundantAppClass. An application selecting this priority cannot be considered either primary or secondary.

SK_RED_APP_PRI_REMOVED (-1)
Used when an application needs to be removed from an RedundantAppClass for which it has previously registered.

aDataSize

DataSize

aDataBuf

aData can be used by the application to store information useful to this application. The value specified in the request is returned when the RAP is queried via the SK_RedundantAppQuery message.

aTag

An application defined pointer which will be returned to the application when a handler is invoked.

aHandlerFunc

A pointer to a function that is designed to handle messages.

aConID

aConID is a connection identifier specified at connection creation time and used to indicate which LLC an application wishes to communicate with