Class ConnectParams
-
- All Implemented Interfaces:
public final class ConnectParamsConnection parameters.
Contains the required parameters and optional configuration for connecting to the server.
Usage example:
// simplest usage (required parameters only) val params = ConnectParams("your-token") // with optional configuration val params = ConnectParams("your-token").apply { timeLimit = 10 } NCEngine.connect(params) { userId, error -> if (error == null) { // connected successfully } }
-
-
Field Summary
Fields Modifier and Type Field Description private Integertimeoutprivate BooleanreconnectKickEnableprivate final Stringtoken
-
Constructor Summary
Constructors Constructor Description ConnectParams(String token)
-
Method Summary
Modifier and Type Method Description final IntegergetTimeout()Connection timeout in seconds. final UnitsetTimeout(Integer timeout)Connection timeout in seconds. final BooleangetReconnectKickEnable()Whether to kick out the reconnecting device when another device is already connected. final UnitsetReconnectKickEnable(Boolean reconnectKickEnable)Whether to kick out the reconnecting device when another device is already connected. final StringgetToken()-
-
Method Detail
-
getTimeout
final Integer getTimeout()
Connection timeout in seconds. Defaults to -1 (no limit).
If exceeded, the connection attempt is considered timed out and the timeout callback is triggered. -1 uses the SDK's default timeout strategy.
-
setTimeout
final Unit setTimeout(Integer timeout)
Connection timeout in seconds. Defaults to -1 (no limit).
If exceeded, the connection attempt is considered timed out and the timeout callback is triggered. -1 uses the SDK's default timeout strategy.
-
getReconnectKickEnable
final Boolean getReconnectKickEnable()
Whether to kick out the reconnecting device when another device is already connected.
When the user does not have multi-device login enabled, if the same account logs in on a new device while the old device is reconnecting, this flag controls the behavior:
false(default): The reconnecting device will kick out the already-connected device.true: The reconnecting device will be kicked out instead, keeping the already-connected device online.
-
setReconnectKickEnable
final Unit setReconnectKickEnable(Boolean reconnectKickEnable)
Whether to kick out the reconnecting device when another device is already connected.
When the user does not have multi-device login enabled, if the same account logs in on a new device while the old device is reconnecting, this flag controls the behavior:
false(default): The reconnecting device will kick out the already-connected device.true: The reconnecting device will be kicked out instead, keeping the already-connected device online.
-
getToken
final String getToken()
-
-
-
-