To use client applications in C in remote mode, you must establish a connection to the Gateway daemon Client protocol handler using the specified host name and port number.
int CTG_openRemoteGatewayConnection(
char * address,
int port,
CTG_ConnToken_t* gwTokPtr,
int connTimeout
)
int CTG_openRemoteGatewayConnectionApplid(
char * address,
int port,
CTG_ConnToken_t* gwTokPtr,
int connTimeout,
char * applid,
char * applidQualifier
)
Use CTG_openRemoteGatewayConnectionApplid in preference to CTG_openRemoteGatewayConnection, as this allows a Client APPLID and APPLID qualifier to be set enabling requests from the Client application to be tracked.
The connection to a Gateway daemon is established using the specified host name and port number. If the connection is successful the Gateway token is returned in the gwTokPtr parameter. The Gateway token is required to interact with that Gateway daemon on further API calls.
CTG_closeGatewayConnection(CTG_GatewayToken_t * gwTokPtr)
CTG_closeAllGatewayConnections( )
The CTG_closeGatewayConnection function frees a single Gateway connection held by the API.The CTG_closeAllGatewayConnections function attempts to free all resources held by the API, including open Gateway daemon connections. This function is for use in the event of a severe error because it enables some form of controlled shutdown even if all gateway tokens (gwTokens) have been lost.
The APPLID and APPLID qualifier of the client application can be overridden at run time by setting the environment variables CTG_APPLID and CTG_APPLIDQUALIFIER to the desired values. The environment variable values override any values passed to the CTG_openRemoteGatewayConnectionApplid function and are also available to existing ECI V2 and ESI V2 applications without requiring the application to be recompiled.