LlmSetTimeout Function  
 
BOOL WINAPI LlmSetTimeout(
  HCLIENT hClient,  
  UINT nTimeout  
);

The LlmSetTimeout function sets the number of seconds the client will wait for a blocking operation to complete.

Parameters

hClient
Handle to the client session.
nTimeout
The number of seconds to wait for a blocking operation to complete.

Return Value

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

Remarks

The LlmSetTimeout function sets the timeout period, in seconds, for blocking operations such as sending a message to the server. If a request does not complete within the specified time, the operation will fail and return a timeout error.

The minimum timeout period is 5 seconds and the maximum timeout period is 300 seconds. If a value outside this range is specified, it will be clamped to the nearest supported value. Specifying a value of zero resets the timeout to the default value of 60 seconds.

The appropriate timeout value may vary depending on the selected provider, model, and network conditions. Larger or more complex models may require additional time to generate a response. Locally hosted models may also require longer timeouts depending on the available hardware resources, such as CPU or GPU performance.

The maximum timeout period is intended to prevent applications from waiting indefinitely for a response. If an operation consistently requires several minutes to complete, applications should consider performing the request on a background thread or using a smaller or faster model.

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

LlmConnect, LlmGetTimeout, LlmSendMessage, LlmSendMessageEx, LlmSetCacheTime, LlmSetIdleTime