public final class WebSocketCall extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the request, if possible.
|
static WebSocketCall |
create(OkHttpClient client,
Request request)
Prepares the
request to create a web socket at some point in the future. |
void |
enqueue(WebSocketListener listener)
Schedules the request to be executed at some point in the future.
|
public static WebSocketCall create(OkHttpClient client, Request request)
request to create a web socket at some point in the future.public void enqueue(WebSocketListener listener)
The dispatcher defines when the request will run:
usually immediately unless there are several other requests currently being executed.
This client will later call back responseCallback with either an HTTP response or a
failure exception. If you cancel() a request before it completes the callback will not
be invoked.
IllegalStateException - when the call has already been executed.public void cancel()
Copyright © 2015. All Rights Reserved.