tubesock 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tubesock.rb +12 -8
- data/lib/tubesock/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c48da440c1ae157b46aa7ea662935192dbeec123
|
4
|
+
data.tar.gz: bb35b9be6dbb7c63de9d0cfca245629d55acf3c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d99b7f0fda2a63d65563f08b12d1033138311ce2e4efe42cc9251c1fddc43cda758018d26734898937d6f1a04208d4040221e0f666d2f5a30b0abd4bfce32123
|
7
|
+
data.tar.gz: c0fd8b3ec5a98296b2e871fbceb92805ad91d2aa032cc489904d3ad0b03ded56ce7230f616eb164ef1201c0504e157c1b5f7709cc0914cf16d3e4afb50ce9563
|
data/lib/tubesock.rb
CHANGED
@@ -39,7 +39,7 @@ class Tubesock
|
|
39
39
|
type: type
|
40
40
|
)
|
41
41
|
@socket.write frame.to_s
|
42
|
-
rescue IOError
|
42
|
+
rescue IOError, Errno::EPIPE
|
43
43
|
close
|
44
44
|
end
|
45
45
|
|
@@ -73,17 +73,17 @@ class Tubesock
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def keepalive
|
76
|
-
Thread.new do
|
76
|
+
thread = Thread.new do
|
77
77
|
Thread.current.abort_on_exception = true
|
78
78
|
loop do
|
79
79
|
sleep 5
|
80
|
-
ping
|
80
|
+
send_data nil, :ping
|
81
81
|
end
|
82
82
|
end
|
83
|
-
end
|
84
83
|
|
85
|
-
|
86
|
-
|
84
|
+
onclose do
|
85
|
+
thread.kill
|
86
|
+
end
|
87
87
|
end
|
88
88
|
|
89
89
|
private
|
@@ -94,8 +94,12 @@ class Tubesock
|
|
94
94
|
break if data.empty?
|
95
95
|
framebuffer << data
|
96
96
|
while frame = framebuffer.next
|
97
|
-
|
98
|
-
|
97
|
+
case frame.type
|
98
|
+
when :close
|
99
|
+
return
|
100
|
+
when :text, :binary
|
101
|
+
yield frame.data
|
102
|
+
end
|
99
103
|
end
|
100
104
|
end
|
101
105
|
rescue Errno::ECONNRESET
|
data/lib/tubesock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tubesock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Gauthier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -147,10 +147,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.0.
|
150
|
+
rubygems_version: 2.0.5
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Handle websocket connections via Rack and Rails 4 using concurrency
|
154
154
|
test_files:
|
155
155
|
- test/test_helper.rb
|
156
156
|
- test/tubesock_test.rb
|
157
|
+
has_rdoc:
|