WebSocketAdapter class abstract

Abstract adapter interface for WebSocket implementations This allows for easy switching between different WebSocket libraries

Implementers

Constructors

WebSocketAdapter.new()

Properties

config WebSocketConfig
Configuration used for this adapter
no setter
currentState WebSocketState
Current connection state
no setter
errorStream Stream
Stream of connection errors
no setter
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Checks if the connection is closed
no setter
isConnected bool
Checks if the connection is currently active
no setter
isConnecting bool
Checks if the connection is in a connecting state
no setter
messageStream Stream<WebSocketMessage>
Stream of incoming messages
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateStream Stream<WebSocketState>
Stream of connection state changes
no setter

Methods

connect() Future<void>
Establishes a WebSocket connection
disconnect([int? code, String? reason]) Future<void>
Closes the WebSocket connection
dispose() Future<void>
Disposes of the adapter and cleans up resources
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(dynamic data) Future<void>
Sends raw data through the WebSocket
sendMessage(WebSocketMessage message) Future<void>
Sends a message through the WebSocket
toString() String
A string representation of this object.
inherited

Operators

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