• Ensures a usable local-control session for nodeId, connecting (with retries) when the adapter reports none.

    The adapter resolves on a successful handshake and rejects otherwise, so a resolved connect is treated as connected.

    Parameters

    • adapter: ESPLocalControlAdapterInterface

      Adapter to drive.

    • nodeId: string

      Node to connect to.

    • metadata: Record<string, any>

      Local transport metadata (baseUrl, securityType, pop, username).

    • Optionaloptions: ESPLocalControlSessionOptions

      Session endpoints for the protocol in use; omitted for the adapter's built-in default paths.

    • maxRetries: number = DEFAULT_CONNECT_RETRIES

      Connection attempts before failing.

    Returns Promise<void>

    When every connection attempt fails.