This method of the Connection class indicates how long to wait while establishing a connection before terminating the attempt and generating an error.
public int getConnectionTimeout();
Returns an integer representing the timeout in seconds.