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.



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

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)


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

def closed?
  with_timeout { not listening? }
end

#connected?Boolean

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

Returns:

  • (Boolean)


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

def connected?
  with_timeout { listening? }
end