faye-websocket 0.10.5 → 0.10.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of faye-websocket might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -1
- data/examples/autobahn_client.rb +2 -3
- data/lib/faye/websocket/api.rb +6 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b6bf17084f08c82f3d0d7ac138e98ddd2a0f059
|
4
|
+
data.tar.gz: 8b86e6161c6c6822f46675a8ac7644ad64257be8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41099891f06201e60913915da0bec5f3420b2ebaf955a80d5c17cf7d3cab53feac35e0a7376ad301880eb5245f9e7412304c4a448abdbb4a942c535d46c780a8
|
7
|
+
data.tar.gz: 66350cd838a0a77e20285130c28bcbe2a197d7179c729866ec5d38d78c8635c212c57670ca2496e0d292f1279825d21624b4a341a1e64df7a8fa83f1d6ab8f60
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -493,7 +493,7 @@ end
|
|
493
493
|
|
494
494
|
(The MIT License)
|
495
495
|
|
496
|
-
Copyright (c) 2010-
|
496
|
+
Copyright (c) 2010-2017 James Coglan
|
497
497
|
|
498
498
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
499
499
|
this software and associated documentation files (the 'Software'), to deal in
|
data/examples/autobahn_client.rb
CHANGED
@@ -18,13 +18,12 @@ EM.run {
|
|
18
18
|
socket.onmessage = lambda do |event|
|
19
19
|
puts "Total cases to run: #{event.data}"
|
20
20
|
cases = event.data.to_i
|
21
|
-
progress = ProgressBar.
|
21
|
+
progress = ProgressBar.create(:title => 'Autobahn', :total => cases)
|
22
22
|
end
|
23
23
|
|
24
24
|
run_case = lambda do |n|
|
25
25
|
if n > cases
|
26
26
|
socket = Faye::WebSocket::Client.new("#{host}/updateReports?agent=#{agent}")
|
27
|
-
progress.finish
|
28
27
|
socket.onclose = lambda { |e| EM.stop }
|
29
28
|
next
|
30
29
|
end
|
@@ -37,7 +36,7 @@ EM.run {
|
|
37
36
|
end
|
38
37
|
|
39
38
|
socket.on :close do |event|
|
40
|
-
progress.
|
39
|
+
progress.increment
|
41
40
|
run_case[n + 1]
|
42
41
|
end
|
43
42
|
end
|
data/lib/faye/websocket/api.rb
CHANGED
@@ -10,6 +10,8 @@ module Faye
|
|
10
10
|
CLOSING = 2
|
11
11
|
CLOSED = 3
|
12
12
|
|
13
|
+
CLOSE_TIMEOUT = 30
|
14
|
+
|
13
15
|
include EventTarget
|
14
16
|
|
15
17
|
extend Forwardable
|
@@ -36,7 +38,7 @@ module Faye
|
|
36
38
|
@ping_id = 0
|
37
39
|
@buffered_amount = 0
|
38
40
|
|
39
|
-
@close_params = @ping_timer = @proxy = @stream = nil
|
41
|
+
@close_params = @close_timer = @ping_timer = @proxy = @stream = nil
|
40
42
|
@onopen = @onmessage = @onclose = @onerror = nil
|
41
43
|
|
42
44
|
@driver.on(:open) { |e| open }
|
@@ -86,6 +88,8 @@ module Faye
|
|
86
88
|
|
87
89
|
@ready_state = CLOSING unless @ready_state == CLOSED
|
88
90
|
@driver.close(reason, code)
|
91
|
+
|
92
|
+
@close_timer = EventMachine.add_timer(CLOSE_TIMEOUT) { begin_close('', 1006) }
|
89
93
|
end
|
90
94
|
|
91
95
|
def protocol
|
@@ -133,6 +137,7 @@ module Faye
|
|
133
137
|
return if @ready_state == CLOSED
|
134
138
|
@ready_state = CLOSED
|
135
139
|
|
140
|
+
EventMachine.cancel_timer(@close_timer) if @close_timer
|
136
141
|
EventMachine.cancel_timer(@ping_timer) if @ping_timer
|
137
142
|
|
138
143
|
reason = @close_params ? @close_params[0] : ''
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faye-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Coglan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
version: '0'
|
248
248
|
requirements: []
|
249
249
|
rubyforge_project:
|
250
|
-
rubygems_version: 2.
|
250
|
+
rubygems_version: 2.6.8
|
251
251
|
signing_key:
|
252
252
|
specification_version: 4
|
253
253
|
summary: Standards-compliant WebSocket server and client
|