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)