Class: Selenium::WebDriver::SocketPoller

Inherits:
Object
  • Object
show all
Defined in:
rb/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.



26
27
28
29
30
31
# File 'rb/lib/selenium/webdriver/common/socket_poller.rb', line 26

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)


51
52
53
# File 'rb/lib/selenium/webdriver/common/socket_poller.rb', line 51

def closed?
  with_timeout { !listening? }
end

#connected?Boolean

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

Returns:

  • (Boolean)


40
41
42
# File 'rb/lib/selenium/webdriver/common/socket_poller.rb', line 40

def connected?
  with_timeout { listening? }
end