WebSocketClient class

WebSocket 客户端

Constructors

WebSocketClient({AxiosConfig? config})

Properties

hashCode int
The hash code for this object.
no setterinherited
isConnected bool
是否已连接
no setter
reconnectAttempts int
当前重连次数
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
关闭客户端
connect(String url, {WebSocketOptions? options}) Stream<WebSocketMessage>
连接到 WebSocket 端点
disconnect([int? closeCode, String? closeReason]) Future<void>
断开 WebSocket 连接
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping([String? data]) → void
发送 Ping
sendBinary(List<int> data) → void
发送二进制消息
sendJson(Map<String, dynamic> data) → void
发送 JSON 消息
sendText(String message) → void
发送文本消息
toString() String
A string representation of this object.
inherited

Operators

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