public class OkHttpWebSocketClient extends okhttp3.WebSocketListener implements HalfDuplexClient, FullDuplexClient
| 构造器和说明 |
|---|
OkHttpWebSocketClient(okhttp3.OkHttpClient client,
boolean passTaskStarted) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
boolean |
close(int code,
String reason) |
io.reactivex.Flowable<DashScopeResult> |
duplex(FullDuplexRequest req) |
void |
duplex(FullDuplexRequest req,
ResultCallback<DashScopeResult> callback) |
void |
onClosed(okhttp3.WebSocket webSocket,
int code,
String reason) |
void |
onClosing(okhttp3.WebSocket webSocket,
int code,
String reason) |
void |
onFailure(okhttp3.WebSocket webSocket,
Throwable t,
okhttp3.Response response) |
void |
onMessage(okhttp3.WebSocket webSocket,
okio.ByteString bytes) |
void |
onMessage(okhttp3.WebSocket webSocket,
String text) |
void |
onOpen(okhttp3.WebSocket webSocket,
okhttp3.Response response) |
DashScopeResult |
send(HalfDuplexRequest req)
Blocking send http request and get the response body.
|
void |
send(HalfDuplexRequest req,
ResultCallback<DashScopeResult> callback) |
DashScopeResult |
streamIn(FullDuplexRequest req) |
void |
streamIn(FullDuplexRequest req,
ResultCallback<DashScopeResult> callback) |
io.reactivex.Flowable<DashScopeResult> |
streamOut(HalfDuplexRequest req) |
void |
streamOut(HalfDuplexRequest req,
ResultCallback<DashScopeResult> callback) |
public OkHttpWebSocketClient(okhttp3.OkHttpClient client,
boolean passTaskStarted)
public boolean close(int code,
String reason)
close 在接口中 FullDuplexClientclose 在接口中 HalfDuplexClientpublic void cancel()
cancel 在接口中 FullDuplexClientpublic void onClosed(okhttp3.WebSocket webSocket,
int code,
String reason)
onClosed 在类中 okhttp3.WebSocketListenerpublic void onClosing(okhttp3.WebSocket webSocket,
int code,
String reason)
onClosing 在类中 okhttp3.WebSocketListenerpublic void onFailure(okhttp3.WebSocket webSocket,
Throwable t,
okhttp3.Response response)
onFailure 在类中 okhttp3.WebSocketListenerpublic void onMessage(okhttp3.WebSocket webSocket,
String text)
onMessage 在类中 okhttp3.WebSocketListenerpublic void onMessage(okhttp3.WebSocket webSocket,
okio.ByteString bytes)
onMessage 在类中 okhttp3.WebSocketListenerpublic void onOpen(okhttp3.WebSocket webSocket,
okhttp3.Response response)
onOpen 在类中 okhttp3.WebSocketListenerpublic DashScopeResult send(HalfDuplexRequest req)
HalfDuplexClientsend 在接口中 HalfDuplexClientreq - the user input data and parameters.public void send(HalfDuplexRequest req, ResultCallback<DashScopeResult> callback)
send 在接口中 HalfDuplexClientpublic io.reactivex.Flowable<DashScopeResult> streamOut(HalfDuplexRequest req)
streamOut 在接口中 HalfDuplexClientpublic void streamOut(HalfDuplexRequest req, ResultCallback<DashScopeResult> callback)
streamOut 在接口中 HalfDuplexClientpublic DashScopeResult streamIn(FullDuplexRequest req)
streamIn 在接口中 FullDuplexClientpublic void streamIn(FullDuplexRequest req, ResultCallback<DashScopeResult> callback) throws NoApiKeyException, ApiException
streamIn 在接口中 FullDuplexClientNoApiKeyExceptionApiExceptionpublic io.reactivex.Flowable<DashScopeResult> duplex(FullDuplexRequest req) throws NoApiKeyException, ApiException
duplex 在接口中 FullDuplexClientNoApiKeyExceptionApiExceptionpublic void duplex(FullDuplexRequest req, ResultCallback<DashScopeResult> callback) throws NoApiKeyException, ApiException
duplex 在接口中 FullDuplexClientNoApiKeyExceptionApiExceptionCopyright © 2025. All rights reserved.