LlmSetIdleTime Function  
 
BOOL WINAPI LlmSetIdleTime(
  HCLIENT hClient,  
  INT nIdleTime  
);

The LlmSetIdleTime function sets the idle timeout period for the client session.

Parameters

hClient
A handle to the client session.
nIdleTime
An integer value which specifies the idle timeout period in seconds. A value of zero specifies a reasonable default value should be used.

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 LlmSetIdleTime function sets the idle timeout period, in seconds, for the specified client session. This value determines how long the library will retain an open connection between requests before automatically closing it and establishing a new connection when needed.

Setting a lower idle time may result in more frequent reconnections, which can increase overhead but may be desirable in environments where connections are short-lived. Higher values allow connections to be reused for longer periods, which can improve performance when making repeated requests.

Changing this value is only meaningful when the LLM_OPTION_KEEPALIVE option is enabled. If keep-alive is disabled for the session, the connection will not be reused regardless of the idle time setting. If the nIdleTime parameter is set to zero, a new connection is established for each request. In most cases, a default idle time of 15 seconds provides a good balance between performance and compatibility.

This setting applies only to the client. It cannot force a server to maintain a persistent connection for a longer period of time. If a connection is closed due to inactivity, the library will automatically reconnect as needed. This behavior is transparent to the application and does not require any additional function calls.

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

LlmIsConnected, LlmGetIdleTime, LlmSetCacheTime, LlmSetTimeout