rakie 0.0.7 → 0.0.8

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: d49cbaec5f721e084610be70c71ec27438c1fc45433eea9d54b9b72ac89f6b38
4
- data.tar.gz: 49466ddeb64dee351f28453c185f392a37aeb4129abc14430911cd9651ca739d
3
+ metadata.gz: 81b73eacd5a896ae3c13192543965d353a0b2dcd1e1ae021664e91793d130d77
4
+ data.tar.gz: bf30ef52373d98df118064c99aaaf7465e6ac8f684d0d49bea01f7d9c6f1a5ff
5
5
  SHA512:
6
- metadata.gz: 4e66c1558d9f29d382f6a6996241562eed1ea56710bc1b81dcdbec8063db4141d45f7c65a1f395199aadbd693807cd957606e61d8d2423175ba1f5e30711a36a
7
- data.tar.gz: 34e7343b3c0c1f63dedec91f0eef352d24fae53f025fb158080d4418f0d0ce526ce96de8dd2d9229e1ac7588f7d252669aa7f9d666446ac5559210e30e13aa01
6
+ metadata.gz: 8a2152503ca81745b8ed0cc467826cd8efd4d8006b8760ed102500f80c3bc88bf946196d03bc3242f87e7db512152147781384be05d891d51fa4aca4928428d2
7
+ data.tar.gz: 29934b5f3ecf636d047c04b00a83e45ddf54a581476f65b23cfe106f231c9cf399536d42f5b2b194ed96c747c41639999be7009e4521481ae989727b4902e5eb
data/lib/rakie/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Rakie
2
- VERSION = [0, 0, 7]
2
+ VERSION = [0, 0, 8]
3
3
 
4
4
  def self.version_s
5
5
  VERSION.join('.')
@@ -22,7 +22,7 @@ module Rakie
22
22
  end
23
23
 
24
24
  def on_recv(channel, data)
25
- # Log.debug("Rakie::HTTPServer recv: #{data}")
25
+ Log.debug("Rakie::Websocket recv: #{data}")
26
26
 
27
27
  # @type [WebsocketMessage] request
28
28
  message = @recv_message
@@ -34,7 +34,7 @@ module Rakie
34
34
 
35
35
  len = message.parse(data)
36
36
 
37
- Log.debug("Rakie::Websocket receive message: #{message.to_s}")
37
+ Log.debug("Rakie::Websocket receive message: #{message.to_s} parse with #{len}")
38
38
 
39
39
  if message.parse_status == ParseStatus::COMPLETE
40
40
  response = WebsocketMessage.new
@@ -69,7 +69,7 @@ module Rakie
69
69
  channel.close
70
70
 
71
71
  Log.debug("Rakie::Websocket: Illegal message")
72
- return len
72
+ return 0
73
73
  end
74
74
 
75
75
  return len
@@ -109,7 +109,7 @@ module Rakie
109
109
  end
110
110
 
111
111
  send_message = ws_message.to_s
112
- @send_messages << send_message
112
+ @send_messages << ws_message
113
113
 
114
114
  Log.debug("Rakie::Websocket send: #{send_message}")
115
115
 
@@ -135,4 +135,4 @@ module Rakie
135
135
  @channel.write(send_message) # Response data
136
136
  end
137
137
  end
138
- end
138
+ end
@@ -5,7 +5,7 @@ module Rakie
5
5
  @delegate = delegate
6
6
 
7
7
  if http_server == nil
8
- http_server = HttpServer.new(host, port)
8
+ http_server = HttpServer.new(host: host, port: port)
9
9
  end
10
10
 
11
11
  @host = http_server.host
@@ -26,7 +26,6 @@ module Rakie
26
26
 
27
27
  if @delegate
28
28
  @delegate.on_connect(ws_client)
29
- return
30
29
  end
31
30
 
32
31
  @clients[channel] = ws_client
@@ -52,8 +51,10 @@ module Rakie
52
51
  client = @clients[channel]
53
52
 
54
53
  if client
55
- client.on_recv(channel, data)
54
+ return client.on_recv(channel, data)
56
55
  end
56
+
57
+ return data.length
57
58
  end
58
59
 
59
60
  def on_send(channel)
@@ -70,6 +71,8 @@ module Rakie
70
71
  if client
71
72
  client.on_close(channel)
72
73
  end
74
+
75
+ @clients.delete(channel)
73
76
  end
74
77
 
75
78
  def send(message, is_binary=false); end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakit Liang