Set the number of seconds that DB-Library waits for a server response to a request for a DBPROCESS connection.
RETCODE dbsetlogintime(seconds) int seconds;
The timeout value—the number of seconds that DB-Library waits for a login response before timing out. A timeout value of 0 represents an infinite timeout period.
SUCCEED or FAIL.
This routine sets the length of time in seconds that DB-Library will wait for a login response after calling dbopen. The default timeout value is 60 seconds.
When a connection attempt is made between a client and a server, there are two ways in which the connection can fail (assuming that the system is correctly configured):
The machine that the server is supposed to be on is running correctly and the network is running correctly.
In this case, if there is no server listening on the specified port, the machine the server is supposed to be on will signal the client, through a network error, that the connection cannot be formed. Regardless of dbsetlogintime, the connection fails.
The machine that the server is on is down.
In this case, the machine that the server is supposed to be on will not respond. Because “no response” is not considered to be an error, the network will not signal the client that an error has occurred. However, if dbsetlogintime has been called to set a timeout period, a timeout error will occur when the client fails to receive a response within the set period.