Module: EventStore::HTTP::Connect::Controls::Port::Unused
- Defined in:
- lib/event_store/http/connect/controls/port.rb
Class Method Summary collapse
Class Method Details
.get ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/event_store/http/connect/controls/port.rb', line 11 def self.get localhost = IPAddress::Loopback.example (10000..19999).each do |port| begin socket = TCPSocket.new localhost, port socket.close next rescue Errno::ECONNREFUSED return port end end fail end |