Class: Selenium::WebDriver::SocketPoller

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

Constant Summary

Instance Method Summary (collapse)

Constructor Details

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

Returns a new instance of SocketPoller



8
9
10
11
12
13
# File 'rb/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

- (Boolean) closed?

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

Returns:

  • (Boolean)


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

def closed?
  with_timeout { not listening? }
end

- (Boolean) connected?

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

Returns:

  • (Boolean)


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

def connected?
  with_timeout { listening? }
end