OkHttpClient.connectTimeoutMillis
Code IndexAdd Codota to your IDE (free)

Best code snippets using okhttp3.OkHttpClient.connectTimeoutMillis(Showing top 7 results out of 315)

  • Common ways to obtain OkHttpClient
private void myMethod () {
OkHttpClient o =
  • new OkHttpClient()
  • OkHttpClient.Builder builder;builder.build()
  • AI code suggestions by Codota
}
origin: square/okhttp

@Override public int getConnectTimeout() {
 return client.connectTimeoutMillis();
}
origin: square/okhttp

 Response getResponseWithInterceptorChain() throws IOException {
  // Build a full stack of interceptors.
  List<Interceptor> interceptors = new ArrayList<>();
  interceptors.addAll(client.interceptors());
  interceptors.add(retryAndFollowUpInterceptor);
  interceptors.add(new BridgeInterceptor(client.cookieJar()));
  interceptors.add(new CacheInterceptor(client.internalCache()));
  interceptors.add(new ConnectInterceptor(client));
  if (!forWebSocket) {
   interceptors.addAll(client.networkInterceptors());
  }
  interceptors.add(new CallServerInterceptor(forWebSocket));

  Interceptor.Chain chain = new RealInterceptorChain(interceptors, null, null, null, 0,
    originalRequest, this, eventListener, client.connectTimeoutMillis(),
    client.readTimeoutMillis(), client.writeTimeoutMillis());

  return chain.proceed(originalRequest);
 }
}
origin: io.github.openfeign/feign-okhttp

 @Override
 public feign.Response execute(feign.Request input, feign.Request.Options options)
   throws IOException {
  okhttp3.OkHttpClient requestScoped;
  if (delegate.connectTimeoutMillis() != options.connectTimeoutMillis()
    || delegate.readTimeoutMillis() != options.readTimeoutMillis()) {
    requestScoped = delegate.newBuilder()
        .connectTimeout(options.connectTimeoutMillis(), TimeUnit.MILLISECONDS)
        .readTimeout(options.readTimeoutMillis(), TimeUnit.MILLISECONDS)
        .build();
  } else {
   requestScoped = delegate;
  }
  Request request = toOkHttpRequest(input);
  Response response = requestScoped.newCall(request).execute();
  return toFeignResponse(response).toBuilder().request(input).build();
 }
}
origin: com.netflix.feign/feign-okhttp

 @Override
 public feign.Response execute(feign.Request input, feign.Request.Options options)
   throws IOException {
  okhttp3.OkHttpClient requestScoped;
  if (delegate.connectTimeoutMillis() != options.connectTimeoutMillis()
    || delegate.readTimeoutMillis() != options.readTimeoutMillis()) {
    requestScoped = delegate.newBuilder()
        .connectTimeout(options.connectTimeoutMillis(), TimeUnit.MILLISECONDS)
        .readTimeout(options.readTimeoutMillis(), TimeUnit.MILLISECONDS)
        .build();
  } else {
   requestScoped = delegate;
  }
  Request request = toOkHttpRequest(input);
  Response response = requestScoped.newCall(request).execute();
  return toFeignResponse(response);
 }
}
origin: com.squareup.okhttp3/okhttp-urlconnection

@Override public int getConnectTimeout() {
 return client.connectTimeoutMillis();
}
origin: com.squareup.okhttp3/okhttp

 Response getResponseWithInterceptorChain() throws IOException {
  // Build a full stack of interceptors.
  List<Interceptor> interceptors = new ArrayList<>();
  interceptors.addAll(client.interceptors());
  interceptors.add(retryAndFollowUpInterceptor);
  interceptors.add(new BridgeInterceptor(client.cookieJar()));
  interceptors.add(new CacheInterceptor(client.internalCache()));
  interceptors.add(new ConnectInterceptor(client));
  if (!forWebSocket) {
   interceptors.addAll(client.networkInterceptors());
  }
  interceptors.add(new CallServerInterceptor(forWebSocket));

  Interceptor.Chain chain = new RealInterceptorChain(interceptors, null, null, null, 0,
    originalRequest, this, eventListener, client.connectTimeoutMillis(),
    client.readTimeoutMillis(), client.writeTimeoutMillis());

  return chain.proceed(originalRequest);
 }
}
origin: com.squareup.okhttp3/okhttp

 Response getResponseWithInterceptorChain() throws IOException {
  // Build a full stack of interceptors.
  List<Interceptor> interceptors = new ArrayList<>();
  interceptors.addAll(client.interceptors());
  interceptors.add(retryAndFollowUpInterceptor);
  interceptors.add(new BridgeInterceptor(client.cookieJar()));
  interceptors.add(new CacheInterceptor(client.internalCache()));
  interceptors.add(new ConnectInterceptor(client));
  if (!forWebSocket) {
   interceptors.addAll(client.networkInterceptors());
  }
  interceptors.add(new CallServerInterceptor(forWebSocket));

  Interceptor.Chain chain = new RealInterceptorChain(interceptors, null, null, null, 0,
    originalRequest, this, eventListener, client.connectTimeoutMillis(),
    client.readTimeoutMillis(), client.writeTimeoutMillis());

  return chain.proceed(originalRequest);
 }
}
okhttp3OkHttpClientconnectTimeoutMillis

Javadoc

Default connect timeout (in milliseconds).

Popular methods of OkHttpClient

  • newCall
    Prepares the request to be executed at some point in the future.
  • <init>
  • newBuilder
  • dispatcher
  • connectionPool
  • newWebSocket
    Uses request to connect a new web socket.
  • proxy
  • readTimeoutMillis
    Default read timeout (in milliseconds).
  • cache
  • networkInterceptors
    Returns an immutable list of interceptors that observe a single network request and response. These
  • interceptors
    Returns an immutable list of interceptors that observe the full span of each call: from before the c
  • dns
  • interceptors,
  • dns,
  • followRedirects,
  • hostnameVerifier,
  • proxyAuthenticator,
  • sslSocketFactory,
  • writeTimeoutMillis,
  • authenticator,
  • certificatePinner

Popular classes and methods

  • getSystemService (Context)
  • setContentView (Activity)
  • findViewById (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ResultSet (java.sql)
    A table of data representing a database result set, which is usually generated by executing a statem
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)