Remote Procedure Calls
Remote procedure calling (RPC) refers to the concept of executing fragments of code on a remote computer.
With ContRap it is very easy to implement RPC, since the code and the results of the remote computation can simply be transported as strings to or from the remote host. In particular, the answer of the remote host is also a string. To transport data to and from the remote host, you can use the serialization mechanisms of ContRap. Since serialization uses hexadecimal string representation of the data the complete communication protocol for RPC in ContRap can be realized exclusively within the ContRap language.
With ContRap it is very easy to implement RPC, since the code and the results of the remote computation can simply be transported as strings to or from the remote host. In particular, the answer of the remote host is also a string. To transport data to and from the remote host, you can use the serialization mechanisms of ContRap. Since serialization uses hexadecimal string representation of the data the complete communication protocol for RPC in ContRap can be realized exclusively within the ContRap language.
Server side
To run the interpreter of ContRap as an RPC server on a remote host call in your shell
> crp --remote 8000
where you might replace the number 8000 by a port number of your choice. For this tutorial we start the server on the local machine.
> crp --remote 8000
where you might replace the number 8000 by a port number of your choice. For this tutorial we start the server on the local machine.