protocol-websocket 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e079958535576416ddb72c68df979c7d8df7ef808986208917a0511d1ae69a64
|
4
|
+
data.tar.gz: 6d6bfa79a21f935a9ca4928e4fbcc9f0942f822e0efed9bfb53387b2b46fad8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6fcc1de1d57eec7d08dc692af7dbc75c8758d064f98a47f05f8cc7a084dfcf4333cebe2c3e8dbc9c64a562744eb466e816bf28df07e77fc9a3b855e16cf589e
|
7
|
+
data.tar.gz: '095cd95f03d4cb7d3e564725d0ab638917b4ff644ad439316e89700e85f26068b888d425b483be30110c86fca95554c44a5a7f5bd18e84aeac4bbbecd53ac619'
|
@@ -165,7 +165,30 @@ module Protocol
|
|
165
165
|
warn "Unhandled frame #{frame.inspect}"
|
166
166
|
end
|
167
167
|
|
168
|
-
# @
|
168
|
+
# @param buffer [String] a unicode or binary string.
|
169
|
+
def write(buffer)
|
170
|
+
if buffer.encoding == Encoding::UTF_8
|
171
|
+
send_text(buffer)
|
172
|
+
else
|
173
|
+
send_data(buffer)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
# @return [String] a unicode or binary string.
|
178
|
+
def read
|
179
|
+
@framer.flush
|
180
|
+
|
181
|
+
while read_frame
|
182
|
+
if @frames.last&.finished?
|
183
|
+
buffer = @frames.map(&:unpack).join
|
184
|
+
@frames = []
|
185
|
+
|
186
|
+
return buffer
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Deprecated.
|
169
192
|
def next_message
|
170
193
|
@framer.flush
|
171
194
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: protocol-websocket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
rubygems_version: 3.0.
|
143
|
+
rubygems_version: 3.0.3
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: A low level implementation of the WebSocket protocol.
|