Class: Selenium::WebDriver::PortProber
- Inherits:
-
Object
- Object
- Selenium::WebDriver::PortProber
- Defined in:
- lib/selenium/webdriver/common/port_prober.rb
Class Method Summary collapse
Class Method Details
.above(port) ⇒ Object
4 5 6 7 |
# File 'lib/selenium/webdriver/common/port_prober.rb', line 4 def self.above(port) port += 1 until free? port port end |
.free?(port) ⇒ Boolean
17 18 19 20 21 22 |
# File 'lib/selenium/webdriver/common/port_prober.rb', line 17 def self.free?(port) TCPServer.new(Platform.localhost, port).close true rescue SocketError, Errno::EADDRINUSE false end |