websocket连接服务器错误时app端和小程序端触发事件不一致
Open
不明确复现步骤、未提供复现工程
- Dominant language
- JavaScript
- Stars
- 41.6k
- Forks
- 3.7k
- Avg merge
- 7h 6m
- Merged PRs (30d)
- 6
Description
onSocketError
websocket连接服务器错误时
小程序端会触发 onSocketError,onSocketClose 这两个事件
而 app端只会 触发 onSocketError 不会触发 onSocketClose
代码如下:
```
public static websocketConnect() {
uni.connectSocket({
url: CommonUtil.websocketUrl + 'webSocket/message,
complete(res) {
console.log(res)
}
})
uni.onSocketOpen(res => {
console.log(res)
})
uni.onSocketError(res => {
console.log("触发了错误")
})
uni.onSocketClose(res => {
console.log("触发了关闭")
})
}
```
Contributor guide
Assessment
This issue has not been assessed yet.