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.
SMC_RETURN_CODE smc_connect_ex (SMC_CONNECT_ID clientId)
identifies the connection.
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
Connection does not exist. |
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); }
smc_connect_alloc and smc_connect_props must be called before smc_connect_ex.
Each Monitor Client Library connection uses two network connections. If you are running a Monitor Client Library application on a PC and reach the limit on network connections, reconfigure your networking software to raise the limit.
Mode |
Availability |
---|---|
SMC_SERVER_M_LIVE |
Yes |
SMC_SERVER_M_HISTORICAL |
Yes |
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 |
smc_close, smc_connect_alloc