You can set the amount of time a connection waits to time out by using the Connect Timeout or Connection Timeout keywords in the connection string. A value of 0 indicates no limit, and should be avoided in a ConnectionString because an attempt to connect waits indefinitely.
The default is 30 seconds.
You can use the connection string setting and construct the entire connectionstring (inlcuding username and password) to override the connection timeout (Connection Timeout=30). You can change the command timeout using /GlobalSettings/System/Database/CommandTimeout - default is 30.
Java socket timeout Answer: Just set the SO_TIMEOUT on your Java Socket, as shown in the following sample code: String serverName = "localhost"; int port = 8080; // set the socket SO timeout to 10 seconds Socket socket = openSocket(serverName, port); socket.
I have done a bit of searching and can't seem to find the answer I'm looking for, the only answers I could find were to use select to see if the socket had timed out which is what I am already doing.
What I want to know is there anyway to change the length of time before connect()
would timeout? I am currently using select()
which returns with errno
set to EINPROGRESS
until eventually returning with ETIMEDOUT
. Is there anyway I can change the amount of time it takes before this ETIMEDOUT
would occur? Currently it happens after about 60 seconds. I have tried adjusting the timeout value I pass into the select()
call however, this only affects how long it takes before select()
will time out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With