sk_createConnectionWithID()

Description

Use the sk_createConnectionWithID() function to create a connection between your application module and a specific LLC.

Important! If you are using the function sk_appDescriptionData(), the aLabel argument in sk_createConnectionWithID() matches anAppName in sk_appDescriptionData().

Syntax

SK_Connection *sk_createConnectionWithID(int aConid, const char *aLabel, int anAppID, int isForcedFlag, const char *aPriHost, int aPriPort, const char *aBackupHost, int aBackupPort);

Parameters

The function parameters are shown in the table below.

Argument

Description

aConID

aConID is a connection identifier specified by the application and used to refer to an applications connection to a specific LLC. The connection identifier is used by the SwitchKit API to route messages from the application to a specific LLC. The connection identifier is initially defined for the API when the application calls sk_createConnectionWithID() or skts_createConnection() and should be used for any sk_*OnConnection() and skts_*() functions where required.

aLabel

aLabel is a text string used by the application to identify the connection. The value has no meaning to the SwitchKit API and is available for query via sk_getSpecificConnectionLabel() and skts_getSpecificConnectionLabel().

anAppID

anAppID is the application identifier used by the LLC to route messages to the application and to log any events of interest regarding the application. If the caller of the function does not care which application identifier it receives, it can specify -1. This allows LLC to select the next available application identifier beginning at 10. If the specified application identifier is already used, the LLC will assign the next available identifier beginning at the requested identifier, unless the isForcedFlag is set to 1 or sk_initializeConnectionForced() was used to establish the connection with LLC.

isForcedFlag

If isForcedFlag equals 1, then the application identifier for this application will be set to the value specified in anAppID even if that application identifier is being used by another application.

aPriHost

The IP address of the primary LLC with the following format, for example:
"10.10.55.10"

aPriPort

The IP port number the primary LLC the primary LLC is listening to.

aBackupHost

The IP address of the secondary LLC, in the following format, for example: "10.10.55.10". If there is no secondary LLC, this field should be set to "". That is, the 0-length string.

aBackup Port

The IP port for the secondary LLC is listening to.

Return Values

This is one of the functions that returns an integer value pointer of an integer. A NULL pointer indicates an error condition.

Useful Related Functions

sk_*OnConnection();

int sk_closeNamedConnection();

int sk_getLLCSocketDescriptorForConnection();

int sk_getConnectionNameForConnection();

int sk_getConnectionForID;

int sk_destroyConnectionForced();

int sk_appDescriptionData();