Closes a connection that was created with smc_connect_ex. This function terminates the connection but does not deallocate it. Use smc_connect_drop to deallocate a connection structure.
SMC_RETURN_CODE smc_close (SMC_CONNECT_ID clientId, SMC_CLOSE_TYPE closeType)
identifies the connection.
type of close: SMC_CLOSE_REQUEST
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
Connection does not exist. |
This example assumes that you have created a connection and have a clientId.
if (smc_close(clientId,SMC_CLOSE_REQUEST) != SMC_RET_SUCCESS) { printf("smc_close failed\n"); /* do some cleanup */ }
All views (as well as alarms and filters associated with the data items in the view) on the specified connection are also dropped.
smc_close only disconnects a connection. Call smc_connect_drop to deallocate a connection structure.
If smc_close returns a failure, the user is advised to call smc_connect_drop.
Mode |
Availability |
---|---|
SMC_SERVER_M_LIVE |
Yes |
SMC_SERVER_M_HISTORICAL |
Yes |
Error |
Indicates |
---|---|
SMC_RET_INTERNAL_ERROR |
Internal error |
SMC_RET_INVALID_API_FUNCTION |
Invalid use of obsolete and replacement functions in the same connection |
SMC_RET_INVALID_API_FUNC_ SEQUENCE |
Invalid calling sequence of Monitor Client Library functions |
smc_connect_drop, smc_connect_ex