使用IsConnectionOpen替换IsConnected

这里判断是否连接成功使用IsConnectionOpen()方法更准确,因为在断线重连状态IsConnected()也会返回true,但是当断线状态调用BatchReportSubDevicesProperties()会造成阻塞,且无法恢复
This commit is contained in:
Darkgod 2021-07-01 13:58:56 +08:00 committed by GitHub
parent d7642805f2
commit 2cda427fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ func (device *baseIotDevice) DisConnect() {
}
func (device *baseIotDevice) IsConnected() bool {
if device.Client != nil {
return device.Client.IsConnected()
return device.Client.IsConnectionOpen()
}
return false