WsChannelConnection class

An OmnyShellConnection over any WebSocketChannel, with no dart:io dependency — the browser-safe counterpart of WebSocketConnection.

The native WebSocketConnection carries dart:io at file scope (it builds an HttpClient for TLS pinning), which poisons the dart2js build, so the web transport wraps the cross-platform WebSocketChannel here instead. Both translate raw text/binary events to and from OmnyShellFrames with a FrameCodec; undecodable frames are dropped rather than tearing the connection down.

Implemented types

Constructors

WsChannelConnection.fromChannel(WebSocketChannel channel, {FrameCodec? codec})
Wraps an already-connected channel.
factory

Properties

codec FrameCodec
The codec used to (de)serialise frames.
final
done Future<void>
Completes when the connection has fully closed.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
incoming Stream<OmnyShellFrame>
Inbound frames decoded from the peer. A single-subscription stream; it closes when the connection closes.
no setteroverride
isOpen bool
Whether the connection is currently open.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close([int? code, String? reason]) Future<void>
Closes the connection, optionally with a WebSocket code/reason.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(OmnyShellFrame frame) → void
Sends frame to the peer. Silently dropped if the connection is closed.
override
toString() String
A string representation of this object.
inherited

Operators

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