Skip to content



[jvm]\ fun connectTimeout(timeout: Long, unit: TimeUnit): OkHttpClient.Builder


fun connectTimeout(duration: Duration): OkHttpClient.Builder

Sets the default connect timeout for new connections. A value of 0 means no timeout, otherwise values must be between 1 and Integer.MAX_VALUE when converted to milliseconds.

The connect timeout is applied when connecting a TCP socket to the target host. The default value is 10 seconds.