Class: Selenium::WebDriver::SocketPoller

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/common/socket_poller.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port, timeout = 0, interval = 0.25) ⇒ SocketPoller

Returns a new instance of SocketPoller.



8
9
10
11
12
13
# File 'lib/selenium/webdriver/common/socket_poller.rb', line 8

def initialize(host, port, timeout = 0, interval = 0.25)
  @host     = host
  @port     = Integer(port)
  @timeout  = Float(timeout)
  @interval = interval
end

Instance Method Details

#closed?Boolean

Returns true if the server has stopped listening within the given timeout, false otherwise.

Returns:

  • (Boolean)


33
34
35
# File 'lib/selenium/webdriver/common/socket_poller.rb', line 33

def closed?
  with_timeout { not listening? }
end

#connected?Boolean

Returns true if the server is listening within the given timeout, false otherwise.

Returns:

  • (Boolean)


22
23
24
# File 'lib/selenium/webdriver/common/socket_poller.rb', line 22

def connected?
  with_timeout { listening? }
end