Title
Ruby On Rails Pinging a host to check connectivity
Body

Hi,

 We can ping a host using commands on console; but some time in our apps we need to confirm the host connectivity specially in REST kind of works. So, we need to do the following to ascertain network connectivity.

require 'ping'

Ping.pingecho(url_host, timeout, url_port)

It returns boolean value. In case of false state, it will keep on pinging within specified timeout. You can ping to a particular service on a particular port, but that is optional.

Cheers

Alok Anand

Associated Tags
confirm network up, ping, Pinging, ruby on rails ping, ruby ping, test network connectivity, up network ruby,
Created By
alokanand
Created At
2011-12-21 06:22:22 UTC
Last Updated At
2011-12-21 06:22:22 UTC
Add Comment