Skip to content
LICENTIVO / INTEGRATION

Floating license management for desktop software

Limit concurrent desktop software use with floating licenses and heartbeats. Release seats when the last session closes normally; after a crash or lost connection, reclaim them when the lease expires.

Session workflow · all nine SDKsUpdated

Application scenario and acceptance checks

With a five-seat floating license on six distinct devices, the first five active devices occupy the seats and the sixth must be denied. Release the last session on a device before retrying. After a crash or network loss, capacity returns when the lease expires; disconnection does not immediately free a seat or grant offline permission.

1. Set a concurrent seat limit

Floating seats count hardware devices with valid leases. Sessions on the same hardware share one seat; device ID is used when hardware identity is unavailable.

Set the heartbeat and session lease together. Floating licensing requires a heartbeat interval of at least 10 minutes and a lease of at least three intervals. With a 10-minute heartbeat, configure a lease of at least 30 minutes.

A fixed device returns workspace capacity when its online window expires after the last successful contact. Its binding remains. A floating device returns capacity when its last session is released or its lease expires.

2. Acquire a seat at startup

Copy the Product ID from Console > Products. Open that product’s Signing public keys and paste every key ID/public key pair into the initialization code, replacing YOUR_PRODUCT_ID, YOUR_KEY_ID and YOUR_PUBLIC_KEY. Quick integration can generate these public code constants. No product configuration file is required; the SDK defaults to https://www.licentivo.com.

Save the complete Go example as main.go. In a new directory, create a module and install the pinned SDK with the commands below. Replace the public product settings, enter a customer key through the environment, and press Enter to close normally and return the seat.

Go · main.go
package main

import (
    "bufio"
    "context"
    "fmt"
    "os"
    "os/signal"

    licentivo "github.com/spf86/licentivo-sdk"
)

// Copy Product ID and all key ID/public key pairs from the product settings.
const productID = "YOUR_PRODUCT_ID"
var trustedKeys = map[string]string{"YOUR_KEY_ID": "YOUR_PUBLIC_KEY"}

func run() error {
    ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
    defer stop()
    client, err := licentivo.OpenProduct(ctx, productID, trustedKeys,
        os.Getenv("LICENTIVO_LICENSE_KEY"),
        func(err error) { fmt.Fprintln(os.Stderr, "License refresh:", err) })
    if err != nil { return err }
    defer client.Close() // Return the floating seat on a normal exit.

    path := os.Getenv("LICENTIVO_OUTPUT")
    if path == "" { path = "licensed-report.txt" }
    // Every real protected action must perform this check.
    if err := client.RunFeature("export", func() error {
        return os.WriteFile(path, []byte("Licensed floating export\n"), 0600)
    }); err != nil { return err }
    fmt.Println("License OK: export is available")
    fmt.Println("Seat acquired. Press Enter or Ctrl+C to release it.")

    entered := make(chan struct{})
    go func() { _, _ = bufio.NewReader(os.Stdin).ReadString('\n'); close(entered) }()
    select { case <-ctx.Done(): case <-entered: }
    return nil
}

func main() {
    if err := run(); err != nil { fmt.Fprintln(os.Stderr, err); os.Exit(2) }
}
Bash
go mod init licensed-floating
go get github.com/spf86/licentivo-sdk@v0.11.9
LICENTIVO_LICENSE_KEY=YOUR_LICENSE_KEY go run .
PowerShell
go mod init licensed-floating
go get github.com/spf86/licentivo-sdk@v0.11.9
$env:LICENTIVO_LICENSE_KEY = 'YOUR_LICENSE_KEY'
go run .

3. Let the SDK schedule heartbeats

Do not write your own timer or send parallel HTTP heartbeat requests. The SDK uses the authorized interval and renews the session. Keep the client alive while the application is running.

Place RunFeature in every protected handler. If a check is denied, stop that protected action and show a licensing message. Display useful background connection errors; do not assume a startup check permanently authorizes later operations.

An expired lease, revoked license or seat denial is handled by the signed authorization rules. Reconnecting requires a successful server check. Never extend a session by editing local expiry data.

4. Release on a normal exit

Close the client on a normal exit. Go uses defer client.Close(); Java and C# have scoped disposal, C++ and Rust use destruction, Python uses its context manager, and Ruby/JavaScript expose close.

If the application crashes or cannot contact the server during shutdown, the server reclaims the abandoned seat when its session lease expires. That delay is expected; keep a clear message so another user understands when a seat may become available.

Floating licenses count valid leases. Disconnection or a crash does not return capacity immediately; the last session must release or expire.

5. Test with two separate machines

  1. Set a test license to one floating seat. Start the application on computer A.
  2. Start on computer B: the second protected session should be denied while A holds the seat.
  3. Exit A normally, then verify B can acquire a seat.
  4. Close B, start A again and record the issued lease_expires_at. Force-stop A in the test environment without running shutdown. Retry on B before the deadline and verify that it is still denied. Retry after the deadline and verify that B acquires the seat.

Troubleshooting seat conflicts

Node-locked and floating modes have different exit behavior: node-locked shutdown keeps registration, while floating shutdown tries to return a seat. Do not call device unbind every time a node-locked application closes.

A seat-in-use message can be caused by another running instance or a recently crashed process waiting for lease expiry. Review current sessions in the console before increasing the purchased seat count.

File-based first activation is for node-locked licenses. Metered operations still require online reserve and settle calls even when the floating session itself is valid.

Configuration and next steps

Example tested

Environment: Windows x64 host and Alpine Linux x64 guest on one physical computer (QEMU 11.1.1), Go SDK 0.11.8 and MySQL 8.4.13. Both seat probes use the official SDK.

Tests use an isolated local API and MySQL with SDK 0.11.8. Only the API origin and private cache location are redirected for testing. Public registry downloads, Electron, Linux and macOS were not tested in this run.

Commands
go build -o floating-host.exe .
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o floating-guest .
Observed results
Windows and Linux presented different SDK device IDs.
One seat held by Windows: Linux activation returned HTTP 409.
Windows closed the SDK normally under a 30-minute lease: Linux activated immediately.
Windows was force-stopped under an isolated 45-second test lease: Linux received HTTP 409 before the deadline and activated after the real deadline elapsed.