public class IgrClient extends WebSocketClient
| 限定符和类型 | 类和说明 |
|---|---|
static class |
IgrClient.Builder |
callTimeout, connectTimeout, okHttpClient, originHostUrl, pingInterval, readTimeout, request, retryOnConnectionFailure, signature, webSocket, writeTimeout| 构造器和说明 |
|---|
IgrClient(IgrClient.Builder builder) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAppId() |
String |
getAue() |
int |
getCallTimeout() |
okhttp3.OkHttpClient |
getClient() |
int |
getConnectTimeout() |
String |
getEnt() |
Integer |
getFrameSize() |
String |
getHostUrl() |
String |
getOriginHostUrl() |
int |
getPingInterval() |
int |
getRate() |
int |
getReadTimeout() |
okhttp3.Request |
getRequest() |
AbstractSignature |
getSignature() |
int |
getWriteTimeout() |
boolean |
isRetryOnConnectionFailure() |
void |
send(byte[] bytes,
Closeable closeable,
okhttp3.WebSocketListener webSocketListener) |
void |
send(File file,
okhttp3.WebSocketListener webSocketListener)
发送音频文件给性别年龄识别服务端
|
void |
send(InputStream inputStream,
okhttp3.WebSocketListener webSocketListener)
发送文件流给服务端
|
void |
send(String data,
okhttp3.WebSocketListener webSocketListener)
将base64编码后的数据发给性别年龄识别服务端
|
void |
sendMessage(byte[] bytes,
Integer status)
听写发送数据
|
void |
start(okhttp3.WebSocketListener webSocketListener)
听写服务端启动
|
closeWebsocket, createWebSocketConnect, getWebSocket, newWebSocketgetApiKey, getApiSecretpublic IgrClient(IgrClient.Builder builder)
public void start(okhttp3.WebSocketListener webSocketListener)
throws MalformedURLException,
SignatureException
public void sendMessage(byte[] bytes,
Integer status)
public void send(File file, okhttp3.WebSocketListener webSocketListener) throws FileNotFoundException, MalformedURLException, SignatureException
file - 发送的文件FileNotFoundExceptionMalformedURLExceptionSignatureExceptionpublic void send(String data, okhttp3.WebSocketListener webSocketListener) throws MalformedURLException, SignatureException
data - 发送的文件FileNotFoundExceptionMalformedURLExceptionSignatureExceptionpublic void send(InputStream inputStream, okhttp3.WebSocketListener webSocketListener) throws MalformedURLException, SignatureException
inputStream - 需要发送的流MalformedURLExceptionSignatureExceptionpublic void send(byte[] bytes,
Closeable closeable,
okhttp3.WebSocketListener webSocketListener)
throws MalformedURLException,
SignatureException
bytes - closeable - 需要关闭的流,可为空MalformedURLExceptionSignatureExceptionpublic String getEnt()
public String getAue()
public int getRate()
public String getHostUrl()
getHostUrl 在类中 Clientpublic String getOriginHostUrl()
public okhttp3.Request getRequest()
public okhttp3.OkHttpClient getClient()
public boolean isRetryOnConnectionFailure()
public int getCallTimeout()
public int getConnectTimeout()
public int getReadTimeout()
public int getWriteTimeout()
public int getPingInterval()
public AbstractSignature getSignature()
public Integer getFrameSize()
Copyright © 2025. All rights reserved.