Note that the HPF value obtained through the HPF service represent a machine on which the ARC object migrates. The remote machine remains anonymous to the originator application program. After executing a predefined task in its trigger specification the object retracts. In the meanwhile the originator performs an activity in parallel.
namespace testHello{
public class HelloClass{
public static void Main(){
// 1. Connect to local HPFServer
UserInterface_HPFVector.IUser hpfvector;
UserInterface_HPFServer.IUser hpfserver =
(UserInterface_HPFServer.IUser)Activator.GetObject(
typeof(UserInterface_HPFServer.IUser),
"tcp://localhost:8105/HPFServerClass" );
// 2. get HPFVector
hpfvector = hpfserver.getHPFVector(1);
int i = hpfvector.SizeOfHPFVector();
UserInterface_HPFValue.IUser hpf1=null;
hpf1 = hpfvector.getHPFValue(0);
// 3. Instantiate an ARCObject
NSIMyObject.IContainer arcobject = NSIMyObject.Factory.New();
// 4. send created object to remote machine
arcobject.push(hpf1);
// 5. do any work in parallel
Console.WriteLine(``to be executed in parallel'');
// 6. wait for object to come back
arcobject.sync();
// 7. end of program
Console.WriteLine(``the end'');
}
}
}