Connection

data class Connection(val event: ServerSentEvent.Connection) : CoreEvent

Emitted when the real-time server connection transitions between lifecycle states.

The connection is established when CoreClient.start is called and closed when CoreClient.stop is called. The SDK automatically manages reconnection when the connection is interrupted.

Possible states:

  • ServerSentEvent.Connection.Connecting — establishing the connection.

  • ServerSentEvent.Connection.Open — connected and receiving events.

  • ServerSentEvent.Connection.Closed — connection has been closed.

  • ServerSentEvent.Connection.Ping — keep-alive signal received from the server.

For dedicated connection state observation, prefer CoreClient.realtimeConnectionState which provides a focused flow of only connection state changes.

See also

Constructors

Link copied to clipboard
constructor(event: ServerSentEvent.Connection)

Properties

Link copied to clipboard
val event: ServerSentEvent.Connection

The current connection state.