Skip to content

Commit

Permalink
Hotfix for 1.2.2 (#276)
Browse files Browse the repository at this point in the history
* Fix the keepalive implement (#265)

* Release 1.2.3
  • Loading branch information
HJianBo authored Jun 17, 2019
1 parent 520a29a commit 3b046b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CocoaMQTT.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CocoaMQTT"
s.version = "1.2.2"
s.version = "1.2.3"
s.summary = "MQTT v3.1.1 client library for iOS and OS X written with Swift 5"
s.homepage = "https://github.com/emqtt/CocoaMQTT"
s.license = { :type => "MIT" }
Expand All @@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.ios.deployment_target = "9.0"
s.tvos.deployment_target = "9.0"
# s.watchos.deployment_target = "2.0"
s.source = { :git => "https://github.com/emqtt/CocoaMQTT.git", :tag => "1.2.2"}
s.source = { :git => "https://github.com/emqtt/CocoaMQTT.git", :tag => "1.2.3"}
s.source_files = "Source/{*.h}", "Source/*.swift"
s.dependency "CocoaAsyncSocket", "~> 7.6.3"
end
6 changes: 3 additions & 3 deletions Source/CocoaMQTT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,9 @@ extension CocoaMQTT: CocoaMQTTReaderDelegate {
}

// keep alive
// FIXME: if keepalive == 0 --> not set keekalive timer???
if ack == CocoaMQTTConnAck.accept && keepAlive > 0 {
self.aliveTimer = CocoaMQTTTimer.every(Double(self.keepAlive / 2 + 1)) { [weak self] in
if ack == CocoaMQTTConnAck.accept {
let interval = Double(keepAlive <= 0 ? 60: keepAlive)
self.aliveTimer = CocoaMQTTTimer.every(interval) { [weak self] in
guard let weakSelf = self else {return}
if weakSelf.connState == .connected {
weakSelf.ping()
Expand Down

0 comments on commit 3b046b4

Please sign in to comment.