StreamWebSocketEngine<Inc, Out> class
A WebSocket engine implementation that handles low-level WebSocket operations.
Manages the WebSocket connection lifecycle, message encoding/decoding, and event notification. This engine provides the foundation for higher-level WebSocket client functionality by handling the transport layer concerns.
The engine supports both text and binary message formats through the WebSocketMessageCodec and provides callbacks through WebSocketEngineListener for connection events.
- Implemented types
-
- WebSocketEngine<
Out>
- WebSocketEngine<
Constructors
-
StreamWebSocketEngine({WebSocketProvider? wsProvider, WebSocketEngineListener<
Inc> ? listener, required WebSocketMessageCodec<Inc, Out> messageCodec}) - Creates a new instance of StreamWebSocketEngine.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
listener
← WebSocketEngineListener<
Inc> ? -
Sets the listener for WebSocket events.
no getter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
[int? closeCode = CloseCode.normalClosure, String? closeReason = 'Closed by client']) → Future< Result< void> > -
Closes the WebSocket connection.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
WebSocketOptions options) → Future< Result< void> > -
Opens a WebSocket connection with the specified options.
override
-
sendMessage(
Out message) → Result< void> -
Sends a message through the WebSocket connection.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited