EasyServerSession class
服务端会话
Constructors
- EasyServerSession({required WebSocketChannel socket, required String ip})
- 创建实例
Properties
- closeCode → int?
-
连接关闭的状态码
no setter
- closeReason → String?
-
连接关闭的状态信息
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → int
-
自增id
no setter
- info → String
-
信息
no setter
- ip → String
-
ip地址
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String?
-
用户token
no setter
- uid → String?
-
用户id
no setter
Methods
-
bindUser(
String uid, {required String? token}) → void - 绑定用户信息
-
close(
int code, String resaon) → void - 关闭连接
-
delContext(
String key) → void - 删除键值对数据
-
eachChannel(
void callback(String cid)) → void - 遍历已加入的全部推送组
-
getContext<
T> (String key) → T - 读取键值对数据
-
heartick(
) → void - 更新最近收到心跳包的时间
-
isBinded(
) → bool - 是否绑定了uid
-
isExpired(
int timeout) → bool - 是否已经超时未收到心跳包
-
isRepeat(
int reqId, int cacheSize) → bool - 更新流量统计信息,同时返回是否收到重复包
-
joinChannel(
String cid) → void - 加入指定推送组
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
quitChannel(
String cid) → void - 退出指定推送组
-
send(
dynamic data) → void - 发送数据
-
setContext<
T> (String key, T value) → void - 缓存键值对数据
-
toString(
) → String -
A string representation of this object.
inherited
-
unbindUser(
) → void - 解绑用户信息
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited