mqtt-ccutrer 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mqtt/client.rb +7 -7
- data/lib/mqtt/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6edb25957b0e8c0253a47920bea2c49b7062f890364bdb7b85831715d2780fb2
|
4
|
+
data.tar.gz: 8de9202fe28cbcff6b2f95c7fad8e9d87e693713115fff6237d69213021f3a84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d3a01a30f91600f5e5005d1b13c240b4e0b6cb250d3c14f258fd86911cd80b443b9e3b34a1ef6b3c0170746d0b08128559f518aeb8f868218ac08c115fd58c
|
7
|
+
data.tar.gz: 4b4065cedf0deda00ef06d207a7c25f8fb3c968c9ce81558229b469c19349c93fb650d9ca09a7261dbadc99dc802cdab194de49f608589dd9feb37d17fa46c91
|
data/lib/mqtt/client.rb
CHANGED
@@ -661,9 +661,9 @@ module MQTT
|
|
661
661
|
|
662
662
|
def handle_timeouts
|
663
663
|
@acks_mutex.synchronize do
|
664
|
-
|
664
|
+
current_time_local = current_time
|
665
665
|
@acks.each_value do |pending_ack|
|
666
|
-
break unless pending_ack.timeout_at <=
|
666
|
+
break unless pending_ack.timeout_at <= current_time_local
|
667
667
|
|
668
668
|
resend(pending_ack)
|
669
669
|
end
|
@@ -696,19 +696,19 @@ module MQTT
|
|
696
696
|
|
697
697
|
next_ping = @last_packet_received_at + @keep_alive if @keep_alive && !@keep_alive_sent
|
698
698
|
next_ping = @last_packet_received_at + @keep_alive + @ack_timeout if @keep_alive && @keep_alive_sent
|
699
|
-
|
700
|
-
[([timeout_from_acks, next_ping].compact.min ||
|
699
|
+
current_time_local = current_time
|
700
|
+
[([timeout_from_acks, next_ping].compact.min || current_time_local) - current_time_local, 0].max
|
701
701
|
end
|
702
702
|
|
703
703
|
def handle_keep_alives
|
704
704
|
return unless @keep_alive && @keep_alive > 0
|
705
705
|
|
706
|
-
|
707
|
-
if
|
706
|
+
current_time_local = current_time
|
707
|
+
if current_time_local >= @last_packet_received_at + @keep_alive && !@keep_alive_sent
|
708
708
|
packet = MQTT::Packet::Pingreq.new
|
709
709
|
send_packet(packet)
|
710
710
|
@keep_alive_sent = true
|
711
|
-
elsif
|
711
|
+
elsif current_time_local >= @last_packet_received_at + @keep_alive + @ack_timeout
|
712
712
|
raise KeepAliveTimeout
|
713
713
|
end
|
714
714
|
end
|
data/lib/mqtt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mqtt-ccutrer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -159,7 +159,7 @@ homepage: http://github.com/ccutrer/ruby-mqtt
|
|
159
159
|
licenses:
|
160
160
|
- MIT
|
161
161
|
metadata: {}
|
162
|
-
post_install_message:
|
162
|
+
post_install_message:
|
163
163
|
rdoc_options: []
|
164
164
|
require_paths:
|
165
165
|
- lib
|
@@ -174,8 +174,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
- !ruby/object:Gem::Version
|
175
175
|
version: '0'
|
176
176
|
requirements: []
|
177
|
-
rubygems_version: 3.1.
|
178
|
-
signing_key:
|
177
|
+
rubygems_version: 3.1.2
|
178
|
+
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: Implementation of the MQTT protocol
|
181
181
|
test_files:
|