checkLimitsAndMakeRequest

Checks for rate limits and establishes a socket connection if permissible.

Parameters:

  • apiUserName (String): The API username.

  • apiToken (String): The API token.

  • link (String): The link to connect.

  • userName (String): The user's display name.

  • parameters (CheckLimitsAndMakeRequestParameters): The parameters for callbacks and socket handling.

  • validate (Boolean): Whether to validate the primary socket connection.

Overview:

  1. Rate Limiting: Checks if the user has exceeded rate limits

  2. Validation: Validates API credentials and connection parameters

  3. Socket Connection: Establishes socket connection if permissible

  4. Error Handling: Provides fallback behavior for errors

Example Usage:

val options = CheckLimitsAndMakeRequestOptions(
apiUserName = "user123",
apiToken = "token456",
link = "https://mediasfu.com/room/abc123",
userName = "John Doe",
parameters = checkLimitsParameters,
validate = true
)
checkLimitsAndMakeRequest(options)

Platform Notes:

  • Android: Uses Android-specific networking and storage

  • iOS: Uses iOS-specific networking and storage

  • Common: Core logic is platform-agnostic

Parameters

options

Configuration options for checking limits and making requests