Keep-alive on connection
Available only with this kind of connection
A connection to the database can be interrupted at any time at "hardware" level: wire missing, device stand-by, WiFi connection interrupted, etc. When losing a connection, nothing is done by the TCP/IP standard. The server waits for the possible communication from client. HFSQL Client/Server allows you to define a timeout or more precisely a time-to-live (TTL). This allows you to define the frequency at which the server will check the client presence. Without response from the client, the connection is closed and the current transactions are freed: no more "ghost" connections because of mobile devices! To configure the keep-alive on connection on an HFSQL server: - Programmatically: use HSetServer associated with the hkaInterval and hkaTimeout constants:
- the hkaInterval constant is used to define the maximum time (in seconds) after which, if no communication is established between the server and the client, the server will check the presence of client. This time is set to 30 minutes by default.
- the hkaTimeout constant is used to define the server timeout when checking the presence of client. If the client is not found at the end of this timeout, the client is automatically disconnected (server side). This duration is set to 2 minutes by default.
- Via the HFConf.INI file:
- the KeepAliveInterval keyword of INIT section is used to define the maximum time (in seconds) after which, if no communication is established between the server and the client, the server will check the presence of client. This time is set to 30 minutes by default.
- the KeepAliveTimeout keyword of INIT section is used to define the server timeout when checking the presence of client. If the client is not found at the end of this timeout, the client is automatically disconnected (server side). This duration is set to 2 minutes by default.
This page is also available for…
|
|
|
|