The CometChat SDK maintains a persistent WebSocket connection for real-time events. TheDocumentation Index
Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
OnConnectionStateChanged delegate lets you track the connection lifecycle and show appropriate UI (e.g., a “Reconnecting…” banner).
Listen for Connection Changes
- Blueprint
- C++
- Get a reference to the CometChat Subsystem
- Drag off and search for On Connection State Changed
- Use Bind Event to connect it to a custom event
- The custom event receives an
ECometChatConnectionStateenum value
ECometChatConnectionState
| Value | Description |
|---|---|
Connected | WebSocket is active. Real-time events (messages, presence, typing, receipts) are flowing. |
Disconnected | WebSocket is closed. No real-time events will be received until reconnection. |
Reconnecting | The SDK detected a disconnect and is automatically attempting to reconnect. |
Reconnection Behavior
The SDK handles reconnection automatically:- When the WebSocket drops (network change, server timeout, etc.), the state moves to
Reconnecting - The SDK retries with exponential backoff
- On successful reconnection, the state moves back to
Connected - If reconnection fails permanently, the state moves to
Disconnected
While disconnected, you can still call async nodes like Get Messages Async — those use HTTP requests, not the WebSocket. Only real-time push events are affected by the connection state.
Next Steps
Real-Time Events
See all five real-time delegates in one place.
API Reference
Complete reference of all nodes, structs, and enums.