streamingConnectionStatus property
- @Deprecated('This method was used in the old streaming API and will be removed in future versions. ' 'Use endpoints with stream parameters or return type to resolve the streaming connection status directly.')
Returns the current status of the streaming connection. It can be one of connected, connecting, or disconnected. Use the StreamingConnectionHandler if you want to automatically reconnect if the connection is lost.
Implementation
@Deprecated(
'This method was used in the old streaming API and will be removed in future versions. '
'Use endpoints with stream parameters or return type to resolve the streaming connection status directly.',
)
StreamingConnectionStatus get streamingConnectionStatus {
if (_webSocket != null && _firstMessageReceived) {
return StreamingConnectionStatus.connected;
} else if (_webSocket != null) {
return StreamingConnectionStatus.connecting;
} else {
return StreamingConnectionStatus.disconnected;
}
}