method

pingecho

v1_8_7_330 - Show latest stable - Class: Ping
pingecho(host, timeout=5, service="echo")
public

Return true if we can open a connection to the hostname or IP address host on port service (which defaults to the “echo” port) waiting up to timeout seconds.

Example:

require 'ping'

Ping.pingecho "google.com", 10, 80