Class: ConnectionThread

Inherits:
Thread
  • Object
show all
Defined in:
lib/jsonrpc2.0-tcp/ConnectionThread.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loginMethodObject

Returns the value of attribute loginMethod.



2
3
4
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 2

def loginMethod
  @loginMethod
end

#restrictObject (readonly)

Returns the value of attribute restrict.



3
4
5
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 3

def restrict
  @restrict
end

#timeoutObject

Returns the value of attribute timeout.



2
3
4
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 2

def timeout
  @timeout
end

Instance Method Details

#loginObject



10
11
12
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 10

def 
	@restrict = nil
end

#start_timeout(timeout) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 14

def start_timeout(timeout)
	@timeoutThread.exit unless @timeoutThread == nil

	@timeoutThread = Thread.start(self, timeout) do |thread, timeout|
		sleep timeout
		thread.exit
	end
end

#stop_timeoutObject



23
24
25
26
27
28
# File 'lib/jsonrpc2.0-tcp/ConnectionThread.rb', line 23

def stop_timeout
	unless @timeoutThread == nil
		@timeoutThread.exit
		@timeoutThread = nil
	end
end