tencent cloud

API Overview

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-05-21 11:44:07

MpAccClient

Main entry point for SDK features:
API
Description
getInstance
Get the MpAccClient singleton instance
setDataKey
Set Device secret key
setSign
Set application signature authentication
setRegionalAccess
Set whether to use region-based access point assignment
setConnectTimeout
Sets connection timeout.
setLogInfoCallback
Set the log information callback interface
setLogLevel
Set the log level
prepare
Obtain the VPN authentication Intent
updateTCPDirect
Dynamically update TCP direct-connection status
updateUDPDirect
Dynamically update UDP direct-connection status
startAcc
Start acceleration
stopAcc
Stop acceleration
startMeasure
Enable network measurement
stopMeasure
Stop network measurement
registerAccCallback
Register a callback to listen for acceleration status
unregisterAccCallback
Unregister the callback to listen for acceleration status
registerMeasureCallback
Register a callback to listen for network measurement results
unregisterMeasureCallback
Unregister the callback to listen for network measurement results
requestNetwork
Request network
releaseNetwork
Release network
register
Pre-register
getSdkVersion
Obtaining the SDK Version Number

getInstance

Retrieve the MpAccClient instance.
public static MpAccClient getInstance(Context context)
Parameter description:
Parameter
Type
Description
context
Context
ApplicationContext

setDataKey

Set the Device secret key for authentication of Self-owned device
public static void setDataKey(String uuid, String dataKey)
Parameter description:
Parameter
Type
Description
uuid
String
Unique device identifier (can reuse the deviceId returned by the cloud API)
dataKey
String
Device key (each dataKey corresponds to one device and cannot be reused)

setSign

Set application signature authentication for application-created devices.a
public static void setSign(String appId, String sign)
Parameter description:
Parameter
Type
Description
appId
String
Application appId
sign
String
Signature string

setRegionalAccess

Set whether to use region-based access point assignment.
public static void setRegionalAccess(boolean isRegionalAccess)
Parameter description:
Parameter
Type
Description
isRegionalAccess
boolean
Whether to use region-based access point assignment
true: Yes
false: No
Default: true

setConnectTimeout

Set the registration timeout duration.
public static void setConnectTimeout(long timeout)
Parameter description:
Parameter
Type
Description
timeout
long
Timeout (seconds)

setLogInfoCallback

Set log callback.
public static void setLogInfoCallback(LogInfoCallback logInfoCallback)
Parameter description:
Parameter
Type
Description
logInfoCallback
LogInfoCallback
log callback instance

setLogLevel

Set the log level. For the Release version, it is recommended to set the log level to Info.
public static void setLogLevel(int level, boolean enablePrint)
Parameter description:
Parameter
Type
Description
level
int
Log level (0-6)
0:PANIC
1:FATAL
2:ERROR
3:WARN
4:Info
5:DEBUG
6:TRACE
enablePrint
boolean
Whether to print logs

prepare

Get the VPN authorization Intent, mainly used to initiate VPN authorization, which the user confirms in the pop-up dialog
Return value: VPN authentication Intent.
public static Intent prepare(Activity activity)
Parameter description:
Parameter
Type
Description
activity
Activity
Current activity

startAcc

Initiate acceleration.
public void startAcc(AccConfig accConfig)
Parameter description:
Parameter
Type
Description
accConfig
AccConfig
Acceleration configuration object

stopAcc

Stop acceleration.
public boolean stopAcc()

startMeasure

Enable network measurement.
Note:
This API is mainly used for network measurement and fallback-to-origin coordination with acceleration, so as to optimize acceleration performance. If you use VPN acceleration for whitelisted applications, you must also add your own application package name to the whitelist. Only after this method is called will probing on the acceleration link take effect.
public void startMeasure(MeasureConfig measureConfig)
Parameter description:
Parameter
Type
Description
measureConfig
MeasureConfig
Network measurement configuration object

stopMeasure

Disable network measurement.
public void stopMeasure()

registerAccCallback

Signup acceleration status callback.
public void registerAccCallback(AccCallback accCallback)
Parameter description:
Parameter
Type
Description
accCallback
AccCallback
Acceleration status callback object

unregisterAccCallback

Cancel listening to acceleration status.

public void unregisterAccCallback(AccCallback accCallback)
Parameter description:
Parameter
Type
Description
accCallback
AccCallback
Acceleration status callback object

registerMeasureCallback

Trigger callback listening for network measurement.
public void registerMeasureCallback(MeasureCallback measureCallback)
Parameter description:
Parameter
Type
Description
measureCallback
MeasureCallback
Network measurement callback object

unregisterMeasureCallback

Cancel callback listening for network measurement.
public void unregisterMeasureCallback(MeasureCallback measureCallback)
Parameter description:
Parameter
Type
Description
measureCallback
MeasureCallback
Network measurement callback object

requestNetwork

Request a network. After this API is called, the activated network interface will participate in acceleration.
public void requestNetwork(int type)
Parameter description:
Parameter
Type
Description
type
int
Network Type
Cellular
1:Wi-Fi

releaseNetwork

Release a network. After this API is called, the activated network interface will no longer participate in acceleration.
public void releaseNetwork(int type)
Parameter description:
Parameter
Type
Description
type
int
Network Type
Cellular
1:Wi-Fi

register

Pre-register. Calling this API in advance after initialization can reduce the time from starting acceleration to successful acceleration.

public void register(boolean isActivateCellular, int mode,
RegisterCallback registerCallback)
Parameter description:
Parameter
Type
Description
isActivateCellular
boolean
Whether to activate cellular. Activating cellular in advance under weak Wi-Fi conditions can reduce acceleration time and improve connection establishment success rate, but it also increases power consumption on the terminal device.
mode
int
Acceleration mode
registerCallback
RegisterCallback
Pre-registration callback object

getSdkVersion

Get SDK version number.
public String getSdkVersion()

LogInfoCallback

Log callback object
void onLogInfoUpdate(String tag, String msg)
API
Description
tag
Tag
msg
Message

registerCallback

Preregister callback object.
API
Description
onRegisterSuccess
Registration succeeded
onRegisterFail
Registration failed

onRegisterSuccess

register successfully.
void onRegisterSuccess()

onRegisterFail

registration failed.
void onRegisterFail(int code)
Parameter description:
Parameter
Type
Description
code
int
Error code. Refer to the error code module.
mode
int
Mode 0: capturing all packets; 1: capturing specific IP address packets (not supported yet)

AccConfig

Acceleration configuration object.
API
Description
setBlackList
Sets the blocklist applications.
setWhiteList
Sets the allowlist applications.
setAccMode
Sets the acceleration mode.
addAccNode
Adds acceleration nodes.
setPingInterval
Sets the callback interval.
setRoute
Sets the routing table.
setAccLinks
Sets the acceleration links.
setPriority
Sets the link priority.
setTCPDirect
Sets tcp direct connection.
setUDPDirect
Sets UDP direct connection.
setAllowBypass
Sets the bound NIC direct connection.
setVpnKeepAlive
Sets whether to keep the acceleration alive.
addNetworkPlugin
Inserts a custom network interface card.
setInt
Sets the int-type configuration parameters.
setString
Sets the String-type configuration parameters.
setBoolean
Sets the boolean-type configuration parameters.
setArrayList
Sets the ArrayList configuration parameters.
setEnableSocks
Sets whether to enable the socks proxy.
setSocksPort
Sets the socks proxy port number.
setSocksUsername
Sets the socks username.
setSocksPassword
Sets the socks password.
setEncryption
Sets whether to enable encryption.
setCongestionMode
Sets the congestion algorithm.
setNetworkConditions
Sets the conditions for network acceleration.
setStartForeground
Whether to start the foreground service.

setBlackList

Set blocklist for apps without acceleration.
public AccConfig setBlackList(ArrayList<String> apps)
Parameter description:
Parameter
Type
Description
apps
ArrayList<String>
List of application package names that do not require acceleration
Sample:
ArrayList<String> blackList = new ArrayList<>();
blackList.add("com.example.app1");
accConfig.setBlackList(blackList);

setWhiteList

Set application allowlist and mode for acceleration.
public AccConfig setWhiteList(ArrayList<String> apps, int mode)
Parameter description:
Parameter
Type
Description
apps
ArrayList<String>
List of application package names that require acceleration
mode
int
Mode 0: capturing all packets; 1: capturing specific IP packets (not supported yet)

setAccMode

Set global acceleration mode.
public AccConfig setAccMode(int mode)
Parameter description:
Parameter
Type
Description
mode
int
Acceleration mode
AccConfig.ACC_MOD_BONDING
Aggregation (applicable to video streaming scenarios)
AccConfig.ACC_MOD_REDUNDANT
Redundancy (applicable to gaming scenarios)
AccConfig.ACC_MOD_FASTSWITCHING
Fast switching (applicable to meeting and cloud gaming scenarios)

addAccNode

Add CDN acceleration node.
Note:
Public cloud gateway not required, automatic connection to the best node.
public AccConfig addAccNode(String ip, int port)
Parameter description:
Parameter
Type
Description
ip
String
Acceleration node IP address
port
int
Acceleration node port number

setPingInterval

Set the callback interval (reporting frequency of AccCallback#onAccDataUpdate).
public AccConfig setPingInterval(int interval)
Parameter description:
Parameter
Type
Description
interval
int
Interval, unit: seconds

setRoute

Set route table and perform acceleration for ALL IPs: setRoute("0.0.0.0",0).
public AccConfig setRoute(String address, int prefixLength)
Parameter description:
Parameter
Type
Description
address
String
IP address
prefixLength
int
Subnet mask network bit length

setAccLinks

Set accelerated link and select network interface cards to perform acceleration.
public AccConfig setAccLinks(int links)
Parameter description:
Parameter
Type
Description
links
int
Acceleration link information
Cellular link: AccConfig.MOBILE_LINK
Wi-Fi link: AccConfig.WIFI_LINK
Ethernet link: AccConfig.ETH_LINK
Cellular + Wi-Fi: The SDK uses AccConfig.WIFI_LINK|AccConfig.MOBILE_LINK by default.

setPriority

Set link priority.
public AccConfig setPriority(HashMap<Integer, Integer> priority
Parameter description:
Parameter
Type
Description
priority
HashMap
Priority map
key: link type 0: mobile 1: Wi-Fi 9: eth
value: a number ranging from 0-255, where a lower number indicates a higher priority. The default value is 64. When the priority number is >= 128, it indicates that the link is a backup link.
priority.put(0,64) sets the priority of the link with type=0 (mobile) to 64.

setUDPDirect

Set UDP direct connection.
public AccConfig setUDPDirect(boolean udpDirect)
Parameter description:
Parameter
Type
Description
udpDirect
boolean
udp direct connection
true: Direct connection
false: No direct connection
Enables direct connection for this interface. After acceleration, all udp traffic will be sent directly to the business server via the default route.

setTCPDirect

Set TCP direct connection.
public AccConfig setTCPDirect(boolean tcpDirect)
Parameter description:
Parameter
Type
Description
tcpDirect
boolean
tcp direct connection
true: Direct connection
false: No direct connection
Enables direct connection for this interface. After acceleration, all tcp traffic will be sent directly to the business server via the default route.

setAllowBypass

Set bind ENI direct connection. VPN mode takes effect.
public AccConfig setAllowBypass(boolean allowBypass)
Parameter description:
Parameter
Type
Description
allowBypass
boolean
tcp direct connection
true: Direct connection
false: No direct connection. The default value is false.
In VPN mode, enabling direct connection for this interface causes traffic from the specified network card to bypass VPN interception.

addNetworkPlugin

Insert custom network interface card, such as com.example.EthNetworkPlugin.
public void addNetworkPlugin(String pluginClassName)
Parameter description:
Parameter
Type
Description
pluginClassName
String
Full class name of the NIC plugin (Refer to FAQ Q4 for details).

setInt

Set int type configuration parameter.
public AccConfig setInt(String key, String value)
Parameter description:
Parameter
Type
Description
key
String
Configuration name, key value:
AccConfig.KEY_MAX_RTT_DISABLE_AGGREGATION
In aggregation mode, links exceeding this value are not included in the aggregation. It is generally not recommended for users to modify this value.
AccConfig.KEY_MAX_DELAY_UNTIL_FAILED
In real-time mode, this is the threshold for determining available links. Links exceeding this value are considered faulty and will not be used until they recover. It is generally not recommended for users to modify this value.
AccConfig.KEY_MIN_SWITCH_RTT
In real-time mode, this is the switching sensitivity. It is generally not recommended for users to modify this value.
AccConfig.KEY_MAX_RTT_THRESHOLD
In aggregation and real-time modes, this is the threshold for enabling link fault detection. Links exceeding this value undergo fault detection. It is generally not recommended for users to modify this value.
AccConfig.KEY_MAX_RETRY_TIMES
Setting the number of Quic connection establishment retries, with a default of 3.
value
String
Value

setString

Set String type configuration parameter.
public AccConfig setString(String key, String value)
Parameter description:
Parameter
Type
Description
key
String
Configuration name, key value:
AccConfig.KEY_SERVER_DOMAIN: Configure domain name
AccConfig.KEY_SECRET_KEY_ID: Secret key ID
AccConfig.KEY_CIPHER_TEXT: Signature string
AccConfig.KEY_SIGNATURE: Digital signature
AccConfig.KEY_T2_OUT: Specify T2 segment acceleration drop-off point
Currently supported egress points: frankfurt siliconvalley saopaulo tokyo bangkok singapore hongkong
If Hong Kong (China) is specified as the egress point:
accConfig.setBoolean(AccConfig.KEY_ENABLE_T2_ACC, true);
accConfig.setString(AccConfig.KEY_T2_OUT, "hongkong");
value
String
Value

setBoolean

Set Boolean type configuration parameter.
public AccConfig setBoolean(String key, boolean value)
Parameter description:
Parameter
Type
Description
key
String
Value for the configuration name key:
AccConfig.KEY_ENABLE_T2_ACC: Enable T2 segment acceleration
AccConfig.KEY_ALLOW_PRIVATE_NETWORK: Private network interconnection
value
String
Value

setArrayList

Set ArrayList<String> type configuration parameter.
public AccConfig setArrayList(String key, ArrayList<String> value)
Parameter description:
Parameter
Type
Description
key
String
Value for the configuration name key:
AccConfig.KEY_APP_ID_LIST AppId list. Pass in the appId of the corresponding application, and the SDK will accelerate the application's allowlist domains in the T2 segment.
value
ArrayList
Value

setEnableSocks

Whether to enable socks proxy (use in socks mode).
public AccConfig setEnableSocks(boolean enableSocks)
Parameter description:
Parameter
Type
Description
enableSocks
boolean
Whether to enable the socks proxy:
true: Enable
false: Disable
Default: false

setSocksPort

Set socks proxy port number.
public AccConfig setSocksPort(int socksPort)
Parameter description:
Parameter
Type
Description
socksPort
int
Sets the socks proxy port number.

setSocksUsername

Set socks username.
public AccConfig setSocksUsername(String socksUsername)
Parameter description:
Parameter
Type
Description
socksUsername
String
socks username

setSocksPassword

Set socks password.
public AccConfig setSocksPassword(String socksPassword)
Parameter description:
Parameter
Type
Description
socksPassword
String
socks password

setEncryption

Set whether to encrypt the message.
public AccConfig setEncryption(boolean encryption)
Parameter description:
Parameter
Type
Description
encryption
boolean
Whether the packet is encrypted:
true: Encrypt
false: Do not encrypt

setCongestionMode

Set congestion control algorithm.
public AccConfig setCongestionMode(int congestionMode)
Parameter description:
Parameter
Type
Description
congestionMode
int
Congestion algorithm parameter:
0: BBR
1: CUBIC
2: BBR-NORMAL
Default value: 0

setNetworkConditions

Set network speed up. If the current terminal does not meet the set acceleration conditions, it will return error code -22.
public AccConfig setNetworkConditions(int conditions)
Parameter description:
Parameter
Type
Description

conditions
int
AccConfig.MUST_WIFI_ACTIVE: The current terminal must have Wi-Fi activated.
AccConfig.MUST_SIM_CARD_READY: The current terminal must have a SIM card inserted.
AccConfig.MUST_MOBILE_DATA_ENABLE: The current terminal must have mobile data enabled.
If you need to add multiple conditions, set them as follows:
AccConfig.MUST_WIFI_ACTIVE|AccConfig.MUST_SIM_CARD_READY

setStartForeground

Set to pull up and speed up the foreground service.
public AccConfig setStartForeground(boolean startForeground)
Parameter description:
Parameter
Type
Description
startForeground
boolean
false: Do not pull up
true: Pull up
Default: true

MeasureConfig

Speed test configuration object. By setting this parameter, you can achieve dynamic acceleration effect.
API
Description
setRTT
Sets the latency threshold.
setLoss
Sets the packet loss rate threshold.
setJitter
Sets the jitter threshold.
setAddr
Sets the speed test address.
setMode
Sets the mode.
setTime
Sets the sliding window measurement time.
setQuickTime
Sets the quick start window time.
setQuickRtt
Sets the quick start latency threshold.
setInterval
Sets the measurement callback frequency.
setPingTimeout
Sets the ping packet timeout.
setT2AccProbeAddr
Sets the T2 segment speed test IP address.
setDisableSlaveLossDetect
Disables slave path packet loss detection.
setAdditionalOptions
Sets the fallback origin custom options.
setStartForeground
Starts the foreground service.

setRTT

Set the latency threshold. When the actual network latency of the terminal in the sliding window is above the set latency threshold, the onStartMpAcc API will be triggered.
public MeasureConfig setRTT(int RTT)
Parameter description:
Parameter
Type
Description
RTT
int
Latency threshold (ms)

setLoss

Set the packet loss threshold. When the actual network packet loss of the terminal in the sliding window is above the set threshold, the onStartMpAcc API will be triggered.
public MeasureConfig setLoss(int loss)
Parameter description:
Parameter
Type
Description
loss
int
Packet loss percentage threshold (0-100)

setJitter

Set the jitter threshold. When the actual network jitter of the terminal in the sliding window is above the set threshold, the onStartMpAcc API will be triggered.
public MeasureConfig setJitter(int jitter)
Parameter description:
Parameter
Type
Description
jitter
int
Network jitter threshold (ms)

setMode

Set the mode and keep it consistent with the mode triggered for acceleration.
public MeasureConfig setJitter(int jitter)
Parameter description:
Parameter
Type
Description
mode
int
Modes are as follows:
Aggregation: AccConfig.ACC_MOD_BONDING
Dual-send: AccConfig.ACC_MOD_REDUNDANT
Fast switching: AccConfig.ACC_MOD_FASTSWITCHING

setTime

Set sliding window measurement time.
public MeasureConfig setTime(int time)
Parameter description:
Parameter
Type
Description
time
int
Measurement duration, in ms

setQuickRtt

Set the quick startup latency threshold. This API is mainly for scenarios with sudden latency spikes. When the actual network latency of the terminal within the quick startup window is above the set quick startup latency threshold, the onStartMpAcc API will be triggered.
public MeasureConfig setQuickRtt(int quickRtt)
Parameter description:
Parameter
Type
Description
quickRtt
int
Quick start latency threshold, unit: ms

setQuickTime

Set quick startup window measurement time.
public MeasureConfig setQuickTime(int quickTime)
Parameter description:
Parameter
Type
Description
quickTime
int
Quick start window time, unit: ms

setInterval

Set measurement callback frequency (onRttChanged reporting frequency).
public MeasureConfig setInterval(int interval)
Parameter description:
Parameter
Type
Description
interval
int
Callback frequency, in ms

setPingTimeout

Set ping packet timeout.
public MeasureConfig setPingTimeout(int pingTimeout)
Parameter description:
Parameter
Type
Description
pingTimeout
int
Timeout, unit: ms

setT2AccProbeAddr

Set T2 speed test IP. Setting this value will enable the SDK to start speed test for T2 drop-off points.
public MeasureConfig setT2AccProbeAddr(String addr)
Parameter description:
Parameter
Type
Description
addr
String
T2 speed test IP.
Europe server:
MeasureConfig.FRANKFURT_ADDRESS
US server:
MeasureConfig.SILICON_VALLEY_ADDRESS
Brazil server:
MeasureConfig.SAO_PAULO_ADDRESS
Japan server:
MeasureConfig.TOKYO_ADDRESS
Thailand server:
MeasureConfig.BANGKOK_ADDRESS
Singapore server:
MeasureConfig.SINGAPORE_ADDRESS
Hong Kong (China):
MeasureConfig.HONG_KONG_ADDRESS

setDisableSlaveLossDetect

Disable secondary path detection for fast switch mode. It is disabled by default. If 100% packet loss occurs on the secondary path within the measurement window, the onStopMpAcc callback will be triggered to remind you to disable acceleration.
public MeasureConfig setDisableSlaveLossDetect(boolean disableSlaveLossDetect)
Parameter description:
Parameter
Type
Description
disableSlaveLossDetect
boolean
true: Disable
false: Do not disable

setAdditionalOptions

Set custom options for emergency origin retrieval.
public MeasureConfig setAdditionalOptions(AdditionalOptions additionalOptions)
Parameter description:
Parameter
Type
Description
additionalOptions
AdditionalOptions
Fallback origin custom object

setStartForeground

Set to pull up the speed test foreground service.
public MeasureConfig setStartForeground(boolean startForeground)
Parameter description:
Parameter
Type
Description
startForeground
boolean
false: Do not pull up
true: Pull up
Default: true

AccCallback

Acceleration status callback object.
API
Description
onAccDataUpdate
Network speed callback
onSummaryInfoUpdate
Acceleration summary information update
onNetworkStateChanged
Network adapter link state change callback
onAccSuccess
Acceleration success callback
onAccFail
Acceleration failure callback

onAccDataUpdate

Network rate callback. The callback frequency is set by {@link AccConfig#setPingInterval(int)}.
void onAccDataUpdate(long tRx, long tTx, ArrayList<PathDetail> pathDetails)
Parameter description:
Parameter
Type
Description
tRx
long
Total received data volume (bytes)
tTx
long
Total transmitted data volume (bytes)
pathDetails
ArrayList
Detailed data for each transmission path

onSummaryInfoUpdate

Speed up information update aggregation. Trigger every time acceleration is complete.
void onSummaryInfoUpdate(String summaryInfo)
Parameter description:
Parameter
Type
Description
summaryInfo
String
Acceleration summary information, which is JSON-formatted summary data containing key metrics such as network quality and acceleration effectiveness.

onNetworkStateChanged

Network interface status change callback.
void onNetworkStateChanged(int type, boolean available, String ip)
Parameter description:
Parameter
Type
Description
type
int
NIC type
0:mobile
1:Wi-Fi
available
boolean
Available or not
ip
String
NIC ip address (IPv4), left blank if unavailable.

onAccSuccess

Success callback.
void onAccSuccess(ArrayList<String> packageNames, String ip, int port)
Parameter description:
Parameter
Type
Description
packageNames
ArrayList
List of successfully accelerated application package names
ip
String
Acceleration server IP address
port
int
Acceleration server port

onAccFail

Failure callback.
void onAccFail(ArrayList<String> packageNames, int errorCode)
Parameter description:
Parameter
Type
Description
packageNames
ArrayList
List of application package names for which acceleration failed
errorCode
int
Error code (see the error code table for details)
Trigger timing: Triggered when the acceleration channel establishment fails.

MeasureCallback

Network measurement callback.
API
Description
onStartMpAcc
Enable acceleration (recommended)
onStopMpAcc
Disable acceleration (recommended)
onStartQos
Enable Qos (recommended)
onNoPolicy
No policy is available for the current network state.
onAccException
The acceleration link is abnormal.
onRttChanged
Callback for bypass udping rtt latency
onAccStateChanged
Acceleration state change callback
onDetectServerUpdate
Callback for speed test ip change

onStartMpAcc

It is advisable to initiate an acceleration callback, which will only be triggered when both Wi-Fi and cellular are online simultaneously.
void onStartMpAcc(int code)
Parameter description:
Parameter
Type
Description
code
int
trigger code
1: Latency Exception Trigger
2: Packet Loss Rate Exception Trigger
3: Jitter exception trigger

onStopMpAcc

Disable acceleration callback.
void onStopMpAcc(int code)
Parameter description:
Parameter
Type
Description
code
int
trigger code
1: Single NIC Trigger
2: No Optimization Trigger
3: No Network Trigger

onStartQos

Enable QoS, only be triggered in single-cell scenario.
void onStartQos(int code)
Parameter description:
Parameter
Type
Description
code
int
trigger code
1: Latency Exception Trigger
2: Packet Loss Rate Exception Trigger
3: Jitter exception trigger

onNoPolicy

Current network status: no policy available.
void onNoPolicy(int code)
Parameter description:
Parameter
Type
Description
code
int
Trigger code
2: Single Wi-Fi
3: No network available
4: Internal Error
5: Speed test service abnormally disconnected
-12: Authentication timeout
-13: Authentication Exception
-19: Speed test service failure
-23: Account authentication failed.

onAccException

Accelerated link exception (in this case, the SDK will proactively close acceleration and speed test, switching back to normal mode).
void onAccException(int errorCode)
Parameter description:
Parameter
Type
Description
errorCode
int
Error Code
-6: acc speed test sustained packet loss exception.
-7: acc speed test maximum latency exception.
-8: acc speed test latency anomaly compared to default route.
-9: acc speed test average latency exceeds maximum threshold.

onRttChanged

Bypass udping rtt latency callback, min interval 500ms.
void onRttChanged(int type, int rtt)
Parameter description:
Parameter
Type
Description

type
int
Type
Speed test from the terminal to the acceleration gateway.
0:mobile
1:Wi-Fi
2:acc
Speed test from the terminal to the T2 offloading point.
1001:default
1002:acc
rtt
int
Latency (ms), default packet loss value: 60000.

onAccStateChanged

Acceleration status change callback.
void onAccStateChanged(int state, int code)
Parameter description:
Parameter
Type
Description
state
int
0: Disabled.
1: Enabled.
code
int
0: Enabled
1: Disabled
2: Abnormal Disable
3: Disable the onRevoke callback.

onDetectServerUpdate

Speed test ip change callback.
void onDetectServerUpdate(int type, String ip, int port)
Parameter description:
Parameter
Type
Description
type
int
Type (0: mobile, 1: Wi-Fi, 2: acc)
ip
String
Speed test IP address
port
int
Speed test port

Error Code

Error Code
Description
-1
VPN fd null pointer exception
-2
MPQUIC exception
-3
Accelerated connection establishment exception
-4
Invalid package name or route address
-5
Acceleration service abnormal disconnection
-6
acc speed test packet loss rate abnormal
-7
acc acceleration maximum latency abnormal
-8
acc speed test latency abnormal compared to Wi-Fi
-9
acc speed test average latency exceeds maximum threshold
-11
Acceleration authentication failure
-12
Authentication connection timeout
-13
Authentication connection exception
-17
Acceleration parameters invalid
-18
Acceleration service startup failure
-19
Speed test service startup failure
-21
Account authentication failure
-22
Network adapter status does not meet acceleration requirements.
-23
Invalid speed test address
-24
Invalid custom network interface card plugin
-25
Invalid acceleration plugin
-26
No active network interface card on the current device.
-28
Terminal UDP ping failure
-29
Acceleration not supported for this device.
-30
Speed test parameters invalid.
-31
Acceleration has been canceled.
-32
HarmonyOS cellular activation restriction is abnormal. It is recommended to restart the machine to recover.
100
Multi-channel acceleration has been started.
101
Multi-channel acceleration internal error
102
Acceleration proxy enabling failure.
103
Invalid acceleration node IP address
104
Invalid acceleration mode
105
Acceleration token authentication failure.
106
The acceleration link notification is disabled. (Check whether multiple devices are reusing the dataKey.)
107
Channel handshake establishment timeout. (Check whether the dataKey is passed in public cloud mode.)
108
Acceleration reconnection timeout
109
SOCKS5 proxy failure
110
Maximum concurrent connections to the current gateway reached.




Ajuda e Suporte

Esta página foi útil?

comentários