next up previous
Next: Understanding the program Up: Moving on Previous: Moving on

The Ping program

The Ping program tries to reach a remote host, and once that task is accomplished, it tries again to reach the original source. Finally, it prints ``Success'' at the original source.

fun ping (source:host, destination:host, outgoing:bool) : unit =
  if outgoing and (thisHost () = destination) then
    OnRemote (ping (destination, source, false), 
              source, getRB (), defaultRoute)
  else
    if not outgoing and (thisHost () = destination) then
      print ("Success")
    else OnRemote (ping (source, destination, outgoing),
                   destination, getRB (), defaultRoute)



Michael Hicks
Mon Nov 24 10:50:43 EST 1997