DisconnectionSource class sealed

Represents the source or cause of a WebSocket disconnection.

A sealed class hierarchy that categorizes different reasons why a WebSocket connection was closed. The disconnection source determines whether automatic reconnection should be attempted and provides context for error handling.

Each source type provides specific information about the disconnection cause:

Constructors

DisconnectionSource.serverInitiated({WebSocketEngineException? error})
Creates a ServerInitiated disconnection source.
const
factory
DisconnectionSource.systemInitiated()
Creates a SystemInitiated disconnection source.
const
factory
DisconnectionSource.unHealthyConnection()
Creates an UnHealthyConnection disconnection source.
const
factory
DisconnectionSource.userInitiated()
Creates a UserInitiated disconnection source.
const
factory

Properties

closeReason String
A human-readable description of the disconnection source.
no setter
hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited