From: Daniel Berger Date: 2010-09-17T07:26:21+09:00 Subject: Re: Net::PingExternal gives an errror On Sep 16, 4:17 pm, Younes Baghor wrote: > thanks it works but its not correct i try them both: > > if Net::Ping::TCP.new('loocaalhost') >   puts 'OK' > else >   puts 'NO respons' > end > > if Net::Ping::External.new('loccalhost') >   puts 'OK' > else >   puts 'NO respons' > end > > this is the output: > OK > OK > webwizartbe-iMac:balbaert younesbaghor$ > > 2 times ok even when the localhost is spelled wrong. You didn't call the ping? method in your example. You just called the constructor. > someone  know what the difference is between > Net::Ping::TCP.new('localhost') > Net::Ping::External.new('localhost') The external ping uses your system's ping command. The TCP ping tries to connect to the host via a Ruby TCPSocket. Regards, Dan