On Sep 16, 4:17     
> 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     > 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