We'll use the PLANStart tool again, and we'll use the active network we set up at the end of Section 3, so our two nodes are m:3324 and m:3325. Suppose that you want to ping m:3325 from m:3324. Also suppose that the ping program is contained in a file called 'ping.plan'. We'll give this program a resource bound of 60 (will be explained later).
Then you invoke the program by the following :
% java PLANStart ping.plan 60 m:3324
And the initial invocation would be :
ping (getHostByName ("m:3324"), getHostByName ("m:3325"), true)
Recall the initial invocation for the Hello World program -- simply the function call doit(). Here, the initial invocation is a bit more complex. We first specify that we want to execute the ping function when we reach our injection node, and then we specify the arguments to give to that function. Here, the first two arguments are themselves function calls. The interesting thing is that these arguments are evaluated locally before being sent to the injection point. Therefore, the getHostByName function is executed locally, on the injecting host in order to resolve hostnames into PLAN values of type host. It is these PLAN values that are actually sent in the PLAN packet. getHostByName is one of a number of local services that are made available to programs using PLANStart. These local service calls may only appear, and will only be evaluated, in the initial invocation provided to PLANStart. For a complete list of local services, please refer to the PLAN Programmer's Guide [3].
After typing this in, you should see a message on your screen :
Success