Class ConnectParams

  • All Implemented Interfaces:

    
    public final class ConnectParams
    
                        

    Connection 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
        }
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectParams(String token)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getTimeout() Connection timeout in seconds.
      final Unit setTimeout(Integer timeout) Connection timeout in seconds.
      final Boolean getReconnectKickEnable() Whether to kick out the reconnecting device when another device is already connected.
      final Unit setReconnectKickEnable(Boolean reconnectKickEnable) Whether to kick out the reconnecting device when another device is already connected.
      final String getToken()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConnectParams

        ConnectParams(String token)
        Parameters:
        token - user authentication token, required
    • 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.