smc_close

Description

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.

Syntax

SMC_RETURN_CODE smc_close
 (SMC_CONNECT_ID        clientId,
 	SMC_CLOSE_TYPE        closeType)

Parameters

clientId

identifies the connection.

closeType

type of close: SMC_CLOSE_REQUEST

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 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 */
 }

Usage


Valid server modes

Mode

Availability

SMC_SERVER_M_LIVE

Yes

SMC_SERVER_M_HISTORICAL

Yes


Errors

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

See also

smc_connect_drop, smc_connect_ex