blazeauth
GuidesCpp

C++ session lifecycle

Connect, initialize, authenticate, keep alive, and reconnect correctly.

C++ session lifecycle

Blazeauth connections are session-based. A typical client keeps one WebSocket open, sends requests through that socket, and restores state after reconnect.

Connect

Open a WebSocket connection to wss://eu1.blazeauth.net.

Initialize

Send initialize as the first request. Until it succeeds, all other requests are undefined.

Authenticate (optional)

Choose one flow: auth_by_license or auth_by_credentials.

Use the API

Call reference operations (variables, files, session values) depending on your needs.

Keep alive

Send ping periodically while the application is active.

Reconnect

After a disconnect, reconnect and repeat: connect → initialize → authenticate (if your features require it).

C++ connection lifecycle
Connect, initialize, authenticate, keep alive, and reconnect.

Reconnect strategy

Treat reconnect as a fresh session

If the socket is closed, consider all client-side Blazeauth state invalid until you reconnect and re-run initialize.

A robust strategy usually includes:

  • exponential backoff with a maximum delay
  • a cap on parallel reconnect attempts (exactly one is recommended)
  • a clean state reset before re-authentication

On this page