jsonrpc2.0-tcp 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jsonrpc2.0-tcp'
3
- s.version = '0.1.3'
3
+ s.version = '0.1.4'
4
4
  s.summary = 'JsonRpc 2.0 TCP client and server'
5
5
  s.authors = ['Jannik Theiß']
6
6
  s.email = 'dev@coldsun.org'
@@ -1,16 +1,4 @@
1
1
  class ConnectionThread < Thread
2
- attr_accessor :loginMethod, :timeout
3
- attr_reader :restrict
4
-
5
- def loginMethod=(method)
6
- @loginMethod = method
7
- @restrict = method
8
- end
9
-
10
- def login
11
- @restrict = nil
12
- end
13
-
14
2
  def start_timeout(timeout)
15
3
  @timeoutThread.exit unless @timeoutThread == nil
16
4
 
@@ -3,9 +3,8 @@ require 'jsonrpc2.0/server'
3
3
  require_relative './ConnectionThread.rb'
4
4
 
5
5
  class JsonRpcTcpServer < JsonRpcServer
6
- def initialize(port, opts = {})
7
- @loginMethod = opts['loginMethod']
8
- @shutdownTimeout = opts['shutdownTimeout']
6
+ def initialize(port, shutdownTimeout)
7
+ @shutdownTimeout = shutdownTimeout
9
8
 
10
9
  @server = TCPServer.new('localhost', port)
11
10
  @runLoop = nil
@@ -20,11 +19,10 @@ class JsonRpcTcpServer < JsonRpcServer
20
19
  loop do
21
20
  thr = ConnectionThread.start(@server.accept) do |conn|
22
21
  selfThread = Thread.current
23
- selfThread.loginMethod = @loginMethod
24
22
 
25
23
  while @runLoop != nil and (message = conn.gets) != nil
26
24
  selfThread.stop_timeout
27
- conn.puts handle_message(message, selfThread.restrict)
25
+ conn.puts handle_message(message)
28
26
  end
29
27
 
30
28
  conn.close
@@ -44,10 +42,6 @@ class JsonRpcTcpServer < JsonRpcServer
44
42
  end
45
43
  end
46
44
 
47
- def login
48
- Thread.current.login
49
- end
50
-
51
45
  def stop
52
46
  @runLoop.exit
53
47
  @runLoop = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonrpc2.0-tcp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-06-27 00:00:00.000000000Z
12
+ date: 2011-06-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonrpc2.0
16
- requirement: &2153192660 !ruby/object:Gem::Requirement
16
+ requirement: &2153328180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 0.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2153192660
24
+ version_requirements: *2153328180
25
25
  description:
26
26
  email: dev@coldsun.org
27
27
  executables: []