websocket-client-simple 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/README.md +5 -1
- data/lib/websocket-client-simple/client.rb +14 -14
- data/lib/websocket-client-simple/version.rb +1 -1
- data/sample/client.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c77561031da6ed2b7c158b90a359714d86c9c4c
|
4
|
+
data.tar.gz: 5e3db2931d4fab5c52438b3dc4373ba69b604bac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 515e8e4fe7f48323186324b6271a25febe05a6b0e52f6e132fef21ff4caaf81dc7c7130ff1eb45c5c08aa34d89778f183ed61ce4ec51a991cba8812c3e5a58e1
|
7
|
+
data.tar.gz: 6b681526e86e0812d3c4bfdac5b23acac4584b367fc9cafae92915bb9798b4aae719d9d074b958fe5852612fe0d3184cdf54c25d8b0696308e433d2c9499a74c
|
data/History.txt
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@ Simple WebSocket Client for Ruby
|
|
5
5
|
- https://github.com/shokai/websocket-client-simple
|
6
6
|
- https://rubygems.org/gems/websocket-client-simple
|
7
7
|
|
8
|
-
[![Build Status](https://travis-ci.org/shokai/websocket-client-simple.png)](https://travis-ci.org/shokai/websocket-client-simple)
|
8
|
+
[![Build Status](https://travis-ci.org/shokai/websocket-client-simple.png?branch=master)](https://travis-ci.org/shokai/websocket-client-simple)
|
9
9
|
|
10
10
|
|
11
11
|
Installation
|
@@ -35,6 +35,10 @@ ws.on :close do |e|
|
|
35
35
|
exit 1
|
36
36
|
end
|
37
37
|
|
38
|
+
ws.on :error do |e|
|
39
|
+
p e
|
40
|
+
end
|
41
|
+
|
38
42
|
loop do
|
39
43
|
ws.send STDIN.gets.strip
|
40
44
|
end
|
@@ -27,20 +27,20 @@ module WebSocket
|
|
27
27
|
while !@closed do
|
28
28
|
begin
|
29
29
|
recv_data = @socket.getc
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
while msg = frame.next
|
42
|
-
emit :message, msg
|
30
|
+
if !@handshaked
|
31
|
+
@hs << recv_data
|
32
|
+
if @hs.finished?
|
33
|
+
@handshaked = true
|
34
|
+
emit :open
|
35
|
+
end
|
36
|
+
else
|
37
|
+
frame << recv_data
|
38
|
+
while msg = frame.next
|
39
|
+
emit :message, msg
|
40
|
+
end
|
43
41
|
end
|
42
|
+
rescue => e
|
43
|
+
emit :error, e
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
@@ -54,7 +54,7 @@ module WebSocket
|
|
54
54
|
frame = ::WebSocket::Frame::Outgoing::Client.new(:data => data, :type => type, :version => @hs.version)
|
55
55
|
begin
|
56
56
|
@socket.write frame.to_s
|
57
|
-
rescue => e
|
57
|
+
rescue Errno::EPIPE => e
|
58
58
|
emit :__close, e
|
59
59
|
end
|
60
60
|
end
|
data/sample/client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: websocket-client-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Hashimoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|