To call an IBM i host program, one need to cooperate with one of the IBM i host servers, the IBM i remote command server, at the TCP socket level. The full name of this server is, remote command and distributed program call server (according to the IBM i info-center). Before the program-call request is really sent to the remote command server, there're several steps have to be done first and some of them are quite time-consuming. For example, establishing a TCP connection with the server, exchanging 8-byte random seeds with the server, sending encrypted password data and user ID to and server and requesting the server to start a PJ (prestarted JOB) job to serve you, etc. At the other hand, if you choose to call programs by reusing a connected program-call object, all the above steps targeting environment initialization and user authentication will NOT happen, the only thing happens when you invoke RemoteCommand.callx() on a connected RemoteCommand instance is the program-call request being sent to the server.
t005.as is an example of calling IBM i APIs and running CL commands in AS3 using AS-400. It's also an example of using a single reusable program-call object during multiple program-calls. The key point of reusing a program-call object is setting the reuse:Boolean arguemnt of class RemoteCommand's constructor to true.