diff --git a/base_device.go b/base_device.go index 4334b63..aa4ccdd 100644 --- a/base_device.go +++ b/base_device.go @@ -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 @@ -165,6 +165,7 @@ func (device *baseIotDevice) Init() bool { options.SetKeepAlive(250 * time.Second) options.SetAutoReconnect(true) options.SetConnectRetry(true) + options.SetConnectRetryInterval(10 * time.Second) options.SetConnectTimeout(2 * time.Second) if strings.Contains(device.Servers, "tls") || strings.Contains(device.Servers, "ssl") { glog.Infof("server support tls connection") diff --git a/go.mod b/go.mod index 3a3a952..6ac193f 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ctlove0523/huaweicloud-iot-device-sdk-go +module github.com/DarkGodOne/huaweicloud-iot-device-sdk-go go 1.15 diff --git a/sdk_info b/sdk_info index 44f418d..f4c9ae0 100644 --- a/sdk_info +++ b/sdk_info @@ -1,2 +1,2 @@ -author = chen tong -sdk-version = v1.0.0 +author = chen tong,changed by darkgod +sdk-version = v1.0.0-patch