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.