Citrix ICA Vuser Functions (CTRX) > Alphabetical List of Functions > ctrx_logoff

ctrx_logoff

Example Information Retrieval Functions

Closes the current session.

int ctrx_logoff( int force, [CONTINUE_ON_ERROR,] CTRX_LAST );

force Use one of the following constants - CTRX_NORMAL_LOGOFF, CTRX_FORCED_LOGOFF or CTRX_FORCED_IF_NORMAL_FAILED, entered as shown without quotes, to specify behavior of the function
CONTINUE_ON_ERROR A constant, entered without quotes. If CONTINUE_ON_ERROR is passed, the script continues to the next step if the logoff fails.
CTRX_LAST A marker that indicates the end of the argument list.

ctrx_logoff performs a normal logoff or a forced logoff, depending on the value of the force argument:

Return Values

Citrix ICA Return Values

Parameterization

Standard parameterization is not available for this function.

Example

In this example, ctrx_logoff is used to attempt a normal logoff. A forced logoff is attempted if the first attempt fails.

/* Try to perform logoff allowing all 
   applications to exit gracefully */
ctrx_logoff(CTRX_NORMAL_LOGOFF, CONTINUE_ON_ERROR, CTRX_LAST);
	
/* If normal logoff timed out, next step executes 
   due to CONTINUE_ON_ERROR in previous call.
    Second call forces all apps to close, 
	even if they lose data. */
ctrx_logoff(CTRX_FORCED_LOGOFF, CTRX_LAST);
			
ctrx_disconnect_server("", CTRX_LAST);