当前位置: 首页>>代码示例>>Java>>正文


Java WebSocketCall.enqueue方法代码示例

本文整理汇总了Java中okhttp3.ws.WebSocketCall.enqueue方法的典型用法代码示例。如果您正苦于以下问题:Java WebSocketCall.enqueue方法的具体用法?Java WebSocketCall.enqueue怎么用?Java WebSocketCall.enqueue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在okhttp3.ws.WebSocketCall的用法示例。


在下文中一共展示了WebSocketCall.enqueue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connect

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public void connect() {
  if (mClosed) {
    throw new IllegalStateException("Can't connect closed client");
  }
  OkHttpClient httpClient = new OkHttpClient.Builder()
      .connectTimeout(10, TimeUnit.SECONDS)
      .writeTimeout(10, TimeUnit.SECONDS)
      .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
      .build();

  Request request = new Request.Builder().url(mUrl).build();
  WebSocketCall call = WebSocketCall.create(httpClient, request);
  call.enqueue(this);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:15,代码来源:InspectorPackagerConnection.java

示例2: connect

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public void connect(String url, JSDebuggerCallback callback) {
  if (mHttpClient != null) {
    throw new IllegalStateException("JSDebuggerWebSocketClient is already initialized.");
  }
  mConnectCallback = callback;
  mHttpClient = new OkHttpClient.Builder()
    .connectTimeout(10, TimeUnit.SECONDS)
    .writeTimeout(10, TimeUnit.SECONDS)
    .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
    .build();

  Request request = new Request.Builder().url(url).build();
  WebSocketCall call = WebSocketCall.create(mHttpClient, request);
  call.enqueue(this);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:16,代码来源:JSDebuggerWebSocketClient.java

示例3: connect

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public void connect() {
  if (mClosed) {
    throw new IllegalStateException("Can't connect closed client");
  }

  OkHttpClient httpClient = new OkHttpClient.Builder()
    .connectTimeout(10, TimeUnit.SECONDS)
    .writeTimeout(10, TimeUnit.SECONDS)
    .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
    .build();

  Request request = new Request.Builder().url(mUrl).build();
  WebSocketCall call = WebSocketCall.create(httpClient, request);
  call.enqueue(this);
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:16,代码来源:ReconnectingWebSocket.java

示例4: connect

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public final void connect() throws IOException {
    if (this.status != ConnectionStatus.CONNECTING) {
        this.status = ConnectionStatus.CONNECTING;
        WebSocketCall ws = WebSocketCall.create(this.client, this.request);
        ws.enqueue(this);
    }
}
 
开发者ID:artikcloud,项目名称:artikcloud-java,代码行数:8,代码来源:WebSocketProxy.java

示例5: connect

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public void connect() {
  if (mClosed) {
    throw new IllegalStateException("Can't connect closed client");
  }
  OkHttpClient  httpClient = new OkHttpClient.Builder()
      .connectTimeout(10, TimeUnit.SECONDS)
      .writeTimeout(10, TimeUnit.SECONDS)
      .readTimeout(0, TimeUnit.MINUTES) // Disable timeouts for read
      .build();

  Request request = new Request.Builder().url(mUrl).build();
  WebSocketCall call = WebSocketCall.create(httpClient, request);
  call.enqueue(this);
}
 
开发者ID:Right-Men,项目名称:Ironman,代码行数:15,代码来源:JSPackagerWebSocketClient.java

示例6: CliWebSocketListener

import okhttp3.ws.WebSocketCall; //导入方法依赖的package包/类
public CliWebSocketListener(OkHttpClient httpClient, WebSocketCall wsc, Config config) {
    this.httpClient = httpClient;
    this.config = config;
    wsc.enqueue(this);
}
 
开发者ID:hawkular,项目名称:hawkular-agent,代码行数:6,代码来源:CommandCli.java


注:本文中的okhttp3.ws.WebSocketCall.enqueue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。