接口 WebSocket.Factory

所有已知实现类:
OkHttpClient
封闭接口:
WebSocket

public static interface WebSocket.Factory
  • 方法详细资料

    • newWebSocket

      WebSocket newWebSocket(Request request, WebSocketListener listener)
      Creates a new web socket and immediately returns it. Creating a web socket initiates an asynchronous process to connect the socket. Once that succeeds or fails, listener will be notified. The caller must either close or cancel the returned web socket when it is no longer in use.