标签: ruby
> require 'net/ping' > Net::Ping::TCP.new('stackoverflow.com').ping? => false
为什么这不会返回true?
true
答案 0 :(得分:3)
您必须将http作为第二个参数传递,如example所示 :
http
p Net::Ping::TCP.new('stackoverflow.com','http').ping? # true