LlmDisconnect Function  
 
INT WINAPI LlmDisconnect(
  HCLIENT hClient  
);

The LlmDisconnect function closes the connection and releases the memory allocated for the client session.

Parameters

hClient
Handle to the client session.

Return Value

If the function succeeds, the return value is zero. If the function fails, the return value is LLM_ERROR. To get extended error information, call LlmGetLastError.

Remarks

The LlmDisconnect function closes the active connection and releases all memory and resources associated with the specified client session. After this function returns successfully, the client handle is no longer valid and must not be used with any other function.

This function also releases the conversation history, cached message and response data, provider information and any other state maintained for the client session. To preserve information from the session, retrieve it before calling this function.

Applications should call LlmDisconnect for every successful call to LlmConnect or LlmConnectEx. This function should be called before LlmUninitialize.

Avoid calling this function while another thread is using the client handle or while a blocking request is in progress. If a request must be canceled, call LlmCancelRequest first and wait for the blocking function to return before disconnecting the client session. The LlmIsBlocking function can tell you if the library is in the middle of processing a blocking operation, such as retrieving the response to a message prompt.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csllmv12.lib

See Also

LlmCancelRequest, LlmConnect, LlmConnectEx, LlmInitialize, LlmIsBlocking, LlmIsConnected, LlmUninitialize