ICMP Ping

Luke Gorrie luke@REDACTED
Mon Feb 7 16:37:02 CET 2005


leo lencioni <lencionil@REDACTED> writes:

> So for my first try to this I will write a small java program that
> will execute a isReachable method . Communications between erlang and
> Java program will be based on standard tcp sockets.

Yikes! Maybe we took your question too literally. What is it you want
to do and why, in high-level terms?

NB: if you do decide to use a helper you could do it more lightweight
than Java, e.g. on GNU:

  -module(test).
  -compile(export_all).

  reachable(Host) ->
      os:cmd("ping -c 1 "++Host++" &>/dev/null; echo $?") == "0\n".

used like this:

  1> test:reachable("localhost").
  true
  2> test:reachable("www.google.com").
  true
  3> test:reachable("1.2.3.4").       
  false




More information about the erlang-questions mailing list