Product Documentation

FairCom Direct SQL for C and C++

Previous Topic

Next Topic

ctsqlSetKeepaliveInterval

Set the connection Keepalive Interval in seconds.

Declaration

CTSQLRET ctsqlSetKeepaliveInterval(pCTSQLCONN hConn, INTEGER value)

Parameters

  • hConn [IN] - the connection handle.
  • value [IN] - the number of seconds to keep alive.

Description

To be used before calling ctsqlConnect. if the connection is active, ctsqlSetKeepaliveInterval will fail. Default (0) indicates no keepalive. a TCP client connection requests a TCP level keepalive probe that is sent after the TCP link has been idle for the specified interval. If the host does not respond to the keepalive probe within 10 seconds, the connection will be treated as broken. This can help achieve 2 goals.1) periodic activity on the link may help prevent network hardware from identifying the connection as idle and silently terminating it. 2) this can distinguish a broken network link from a server operation that takes a long time for the server to respond.

NOTE: Currently supported only on Windows, Linux, and Solaris.

Return

ctsqlSetKeepaliveInterval() returns CTSQLRET_OK on success.

Symbolic Constant

Explanation

SQL_ERR_BADPARAM

Bad parameter specification for the statement.

TOCIndex