smc_connect_alloc

Description

Creates a connection structure with error callback, but does not establish a connection.

Syntax

SMC_RETURN_CODE smc_connect_alloc
 (SMC_GEN_CALLBACK     ErrCallback,
 	SMC_CONNECT_IDP      clientIdHandle)

Parameters

ErrCallback

Pointer to error callback function.

clientIdHandle

Pointer to a variable, which should be declared as type SMC_CONNECT_ID. If the call to smc_connect succeeds, this variable contains the ID for the Monitor connection.

Returns

Return value

Indicates

SMC_RET_SUCCESS

Function succeeded.

SMC_RET_FAILURE

Function failed.

Examples

Example 1

The following example assumes you have defined an error callback function, myErrorHandler.

SMC_CONNECT_ID  clientId;
 if (smc_connect_alloc(myErrorHandler,&clientId) 
 		!= SMC_RET_SUCCESS)
 {
 		printf("smc_connect_alloc 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

See also

smc_connect_drop, smc_connect_ex, smc_connect_props