Posted By

Shamaoke on 03/10/11


Tagged

ruby ping Net


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

WaxWing


Using net http ping


 / Published in: Ruby
 

  1. # encoding = utf-8
  2.  
  3. require 'net/ping'
  4.  
  5. Net::Ping::HTTP.new('http://example.com') do |http|
  6. http.ping ? puts('ok!')
  7. : puts(http.exception)
  8. end

Report this snippet  

You need to login to post a comment.