Connection timeouts are set by an application calling SQLSetConnectAttr with the attribute SQL_ATTR_CONNECTION_TIMEOUT
. Easysoft ODBC-ODBC Bridge 1.0.0.23 only uses the connection timeout when actually connecting to the server and not for all ODBC calls. If you set the connection timeout and the connect does not succeed in the timeout period, you will get a diagnostic like this:
08001:1:4:[Easysoft ODBC (Client)]Client unable to establish connection HY000:2:4:[Easysoft ODBC (Client)]Connection attempt timed out
However, there are some important points:
gethostbyname()
, the call used to resolve a machine name into an IP address, cannot be interrupted and the connection timeout will not work. If this is a problem for you, specify the server machine as an IP address or tell your resolver library to consult /etc/hosts before DSN and place an entry in /etc/hosts.SQL_ATTR_CONNECTION_TIMEOUT
are passed onto the ODBC driver at the Server end.alarm()
and SIGALRM handlers (or sigsetjmp) around your ODBC calls to implement connection timeouts.