smc_connect_ex

Description

Establishes a connection for the connection structure created with smc_connect_alloc. Properties on the connection, such as Server Name and Server Mode, must have been set with smc_connect_props.

Syntax

SMC_RETURN_CODE smc_connect_ex
 (SMC_CONNECT_ID         clientId)

Parameters

clientId

identifies the connection.

Returns

Return value

Indicates

SMC_RET_SUCCESS

Function succeeded.

SMC_RET_FAILURE

Function failed.

SMC_RET_INVALID_CONNECT

Connection does not exist.

Examples

Example 1

This example assumes you have created a connection using smc_connect_alloc and have a clientId.

if (smc_connect_ex(clientId) != SMC_RET_SUCCESS) 
 {
 		printf("smc_connect_ex failed\n");
 		exit(1);
 }

Usage


Valid server modes

Mode

Availability

SMC_SERVER_M_LIVE

Yes

SMC_SERVER_M_HISTORICAL

Yes


Errors

Error

Indicates

SMC_RET_INSUFFICIENT_MEMORY

Insufficient memory

SMC_RET_INTERNAL_ERROR

Internal error

SMC_RET_INVALID_API_FUNCTION

Invalid use of obsolete and replacement functions on the same connection

SMC_RET_INVALID_API_FUNC_SEQUENCE

Invalid calling sequence of Monitor Client Library functions

SMC_RET_INVALID_PROPERTY

Property has not been set

SMC_RET_UNABLE_TO_CONNECT_TO_SMS

Cannot connect to Monitor Server

SMC_RET_UNABLE_TO_CONNECT_TO_SS

Cannot connect to Adaptive Server

See also

smc_close, smc_connect_alloc