API | Description |
The main function of QUIC, used to create QuicCall instances and QUIC configuration and get the version number etc. | |
Manage QUIC requests. | |
Encapsulate requests. | |
Encapsulate responses. | |
Execute callbacks. | |
Get information about QUIC network status. |
API | Description |
Construct QUIC configuration . | |
Get the SDK version number. |
QuicCall newCall(QuicRequest request)
Parameter | Description |
request |
String getVersion()
API | Description |
Set the QUIC version. | |
Set the congestion control algorithm. | |
Set the connection timeout. | |
Set the total timeout for the request. | |
Set the idle connection timeout. | |
Whether to support IPv6. | |
Builder setQuicVersion(int quicVersion)
Parameter | Description |
quicVersion | Set the QUIC version.
Supported versions: Q043, Q046, Q050, Q051, draft-29, RFC-V1 (RFC 9000). Values: QuicClient.QUIC_VERSION_Q43 (default) QuicClient.QUIC_VERSION_Q46 audio/video proxy QuicClient.QUIC_VERSION_Q50 audio/video proxy QuicClient.QUIC_VERSION_Q51 audio/video proxy QuicClient.QUIC_VERSION_IETF_DRAFT_29 audio/video proxy QuicClient.QUIC_VERSION_IETF_RFC_V1 audio/video proxy |
Builder setCongestionType(int congestionType)
Parameter | Description |
congestionType | Supported congestion control algorithms: CubicBytes, RenoBytes, BBR, PCC, GCC. Values: QuicClient.CONGESTION_TYPE_BBR (default) QuicClient.CONGESTION_TYPE_RENO_BYTES QuicClient.CONGESTION_TYPE_BBR QuicClient.CONGESTION_TYPE_PCC QuicClient.CONGESTION_TYPE_GCC |
Builder setConnectTimeoutMillis(int connectTimeoutMillis)
Parameter | Description |
connectTimeoutMillis | Set the connection timeout in milliseconds. Default value: 60000. |
Builder setTotalTimeoutMillis(int totalTimeoutMillis)
Parameter | Description |
totalTimeoutMillis | Set the total timeout in milliseconds. Default value: 0 (no timeout). |
Builder setIdleTimeoutMillis(int idleTimeoutMillis)
Parameter | Description |
idleTimeoutMillis | The idle connection timeout in milliseconds. Default value: 90000. |
Builder setSupportIpV6(boolean supportIpV6)
Parameter | Description |
supportIpV6 audio/video proxy | Whether to support IPv6. Values: true , false .Default value: false . |
QuicClient build()
API | Description |
Initiate an asynchronous QUIC network request. | |
Cancel requests. | |
void enqueue(QuicCallback callback)
Parameter | Description |
callback |
void cancel()
QuicNetStats getQuicNetStats()
API | Description |
Construct a request parameter. |
Builder setUrl(String url)
Parameter | Description |
url | (Required) The request URL. |
Builder setIp(String ip)
Parameter | Description |
ip | (Optional) If you do not use DNS resolution, set the IP address that the hostname resolves to. |
Builder addHeader(String key, String value)
Parameter | Description |
key | Key of the header. |
value | Value of the header. |
Builder get()
Builder post(RequestBody body)
Parameter | Description |
body | Body data. |
Builder method(String method, RequestBody body)
Parameter | Description |
method | Supported request methods: PUT, DELETE, HEAD, PATCH. |
body | Body data. |
QuicRequest build()
API | Description |
Get the response status code. | |
Get the response headers. | |
Get Content-Type. | |
Get Content-Length. | |
Get the response body. |
int getCode()
List<String> getHeaders()
void setContentType(String contentType)
Parameter | Description |
contentType | Get the content type. |
void setContentLength(long contentLength)
Parameter | Description |
contentLength | Get the content length. |
ResponseBody body()
API | Description |
The callback succeeded. | |
The callback failed. |
void onResponse(QuicCall call, QuicResponse response) throws IOException
Parameter | Description |
call | |
response |
void onFailed(QuicCall call, int errorCode, String errorMsg)
Parameter | Description |
call | |
errorCode | The error code. |
errorMsg | The error message. |
API | Description |
isValid | Whether the value of status is valid. |
isQuic | Whether it is a QUIC request. |
is0rtt | Whether it is a 0-RTT connection. |
isConnReuse | Whether the connection is reused. |
getConnectMs | Get the connection duration in milliseconds. |
getDnsMs | Get the DNS duration in milliseconds. |
getDnsCode | Get the DNS error code. |
getTtfbMs | Get the time taken for the first byte to be received in milliseconds. |
getCompleteMs | Get the time taken for the request to be completed in milliseconds. The time taken by the connection is not included. |
getSrttMs | Get the average round-trip time in milliseconds. |
getPacketsSent | Get the number of packets sent in bytes. |
getPacketsRetransmitted | Get the number of packets retransmitted in bytes. |
getBytesSent | Get the number of bytes sent. |
getBytesRetransmitted | Get the number of bytes retransmitted. |
getPacketsLost | Get the number of packets lost in bytes. |
getPacketsReceived | Get the number of packets received in bytes. |
getBytesReceived | Get the number of bytes received. |
getStreamBytesReceived | Get the number of bytes received within the stream. |
Was this page helpful?