class Selenium::WebDriver::SocketPoller

def listening?

see https://github.com/jruby/jruby/issues/5709
we use a plain TCPSocket here since JRuby has issues closing socket
def listening?
  TCPSocket.new(@host, @port).close
  true
rescue *NOT_CONNECTED_ERRORS
  false
end