Skip to content

Commit da020ca

Browse files
Update README.md
1 parent 3fbb97c commit da020ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ hub.onOpen = (res)={
3939

4040
//连接关闭事件
4141
hub.onClose = (res)={
42-
console.log("连接已开启")
42+
console.log("连接已关闭")
4343
};
4444

4545
//通讯过程中的Error事件
4646
hub.onError = (res) =>{
4747
console.log(res)
4848
};
49+
50+
//手动关闭连接
51+
hub.close({reason:"手动关闭"});
4952
```
5053

5154
#### 调用服务端方法(无返回值)

0 commit comments

Comments
 (0)