sk_createConnection()

Description

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

Syntax

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

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

 

 

int skts_createConnection( int aConID, );

Parameters

The function parameters are shown in the next table.

Argument

Description

aConID

aConID is a connection identifier specified by the application and used to refer to an application’s 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 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 instead of a pointer. A NULL pointer indicates an error condition.