Module: Paraspec::Ipc
- Defined in:
- lib/paraspec/ipc.rb
Class Attribute Summary collapse
-
.master_app_port ⇒ Object
readonly
Returns the value of attribute master_app_port.
Class Method Summary collapse
Class Attribute Details
.master_app_port ⇒ Object (readonly)
Returns the value of attribute master_app_port.
23 24 25 |
# File 'lib/paraspec/ipc.rb', line 23 def master_app_port @master_app_port end |
Class Method Details
.pick_master_app_port ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/paraspec/ipc.rb', line 11 def pick_master_app_port port = 10000 + rand(40000) begin server = TCPServer.new('127.0.0.1', port) server.close return @master_app_port = port rescue Errno::EADDRINUSE port = 10000 + rand(40000) retry end end |