WebSocketState enum

Enum representing the current state of a WebSocket connection.

Inheritance
Available extensions

Values

initial → const WebSocketState

Initial state before connection attempt

connecting → const WebSocketState

Attempting to establish connection

connected → const WebSocketState

Connection is open and ready for communication

closing → const WebSocketState

Connection is closing

closed → const WebSocketState

Connection is closed

failed → const WebSocketState

Connection failed to establish

reconnecting → const WebSocketState

Connection lost, attempting to reconnect

suspended → const WebSocketState

Connection is in a suspended state

Properties

canSend bool

Available on WebSocketState, provided by the WebSocketStateExtension extension

Returns true if the connection can send messages
no setter
description String

Available on WebSocketState, provided by the WebSocketStateExtension extension

Returns a human-readable description of the state
no setter
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
isActive bool

Available on WebSocketState, provided by the WebSocketStateExtension extension

Returns true if the connection is active (connected or connecting)
no setter
isClosed bool

Available on WebSocketState, provided by the WebSocketStateExtension extension

Returns true if the connection is closed or failed
no setter
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
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

Constants

values → const List<WebSocketState>
A constant List of the values in this enum, in order of their declaration.