onConnectionInterrupted property

void Function(RtcConnection connection)? onConnectionInterrupted
final

Callback when the network connection is interrupted.

Deprecated Deprecated: Use onConnectionStateChanged callback instead. This callback is triggered when the SDK loses connection to the server for more than 4 seconds after establishing a connection. After this event is triggered, the SDK will try to reconnect to the server. You can use this event to prompt the UI. The difference between this callback and onConnectionLost is: onConnectionInterrupted is triggered only after successfully joining a channel and when the SDK loses connection to the server for more than 4 seconds. onConnectionLost is triggered regardless of whether the user has joined a channel, as long as the SDK cannot connect to the server within 10 seconds. If the SDK still fails to rejoin the channel within 20 minutes after disconnection, it stops trying to reconnect.

  • connection Connection information. See RtcConnection.

Implementation

final void Function(RtcConnection connection)? onConnectionInterrupted;