bogo-websocket 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/bogo-websocket/version.rb +1 -1
- data/lib/bogo-websocket/websocket.rb +10 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21011f628e8dad6781507d7700bc567e5684efc7
|
4
|
+
data.tar.gz: f96c39374cf0d024e38039ec52472ed8ff08338e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf34984efe86f08d81c6368464bcc9f4ff6a0405da1fbcf067284342f75343f634aec87626cc4554eebeddd041866bdc97ecca3a025114d3edc3b59c5e3a354
|
7
|
+
data.tar.gz: 7da091f8504803209e7c34c1b1f6d7e08fe2c270c445e24e01d8a07ecc5db9965ed773dfd76fa91389ba65f6d9012c82f1ad05d7590736a237151d2177a7bd63
|
data/CHANGELOG.md
CHANGED
@@ -61,10 +61,13 @@ module Bogo
|
|
61
61
|
|
62
62
|
# Close the connection
|
63
63
|
def close
|
64
|
-
connection
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
if(connection)
|
65
|
+
connection.close
|
66
|
+
@die = true
|
67
|
+
control_w.write 'closed'
|
68
|
+
container.join unless Thread.current == container
|
69
|
+
@connection = nil
|
70
|
+
end
|
68
71
|
end
|
69
72
|
|
70
73
|
# Start the reader
|
@@ -74,22 +77,21 @@ module Bogo
|
|
74
77
|
until(die || connection.closed?)
|
75
78
|
begin
|
76
79
|
unless(die || connection.closed?)
|
77
|
-
client << connection.read_nonblock(
|
80
|
+
client << connection.read_nonblock(1024)
|
78
81
|
if(message = client.next)
|
79
82
|
handle_message(message)
|
80
83
|
end
|
81
84
|
end
|
82
|
-
rescue IO::WaitReadable,
|
85
|
+
rescue IO::WaitReadable, Errno::EAGAIN => e
|
83
86
|
unless(die || connection.closed?)
|
84
87
|
IO.select([connection, control_r])
|
85
88
|
retry
|
86
89
|
end
|
87
90
|
rescue => error
|
88
91
|
on_error.call(error)
|
89
|
-
|
92
|
+
close
|
90
93
|
end
|
91
94
|
end
|
92
|
-
@connection = nil
|
93
95
|
end
|
94
96
|
end
|
95
97
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bogo-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bogo
|
@@ -97,3 +97,4 @@ signing_key:
|
|
97
97
|
specification_version: 4
|
98
98
|
summary: Simple websocket libraries
|
99
99
|
test_files: []
|
100
|
+
has_rdoc:
|