rpc_factory(type, url)
Creates a new Remote Procedure Call (RPC) handle. Please read the subsection ef{Remote Procedure Call (RPC)} for a more detailed description of RPCs.
>>> proxy = rpc_factory("xmlrpc", "http://127.0.0.1:8080/RPC2")
Parameters
type:
The type of RPC backed to use. Currently only the "xmlrpc" protocol is available.
url:
The URL to the RPC server. Currently two protocols are supported: pstream and http. The pstream URL looks like "<ip-address>:<port>", for instance "127.0.0.1:8080" to make a local connection on port 8080. A http URL generally looks like "http://<ip-address>:<port>/<path>", whereby the <path> depends on the setup of the http server. In the example given above a connection to a local Python webserver on port 8080 is made, which expects XMLRPC calls to come in on the path "RPC2".
Return Value
A RPC handle with a connection to the specified server using the designated RPC backend. If the server is not available the function and program will fail. Any function that is made available on the server can be called using this instance. For example "bool isTargetAvailable(int number, ...)" would be "proxy.isTargetAvailable(var_1, ...)", whereby any number of arguments are supported (denoted by the ...).
Note: Giving the RPC instance a good name makes programs much more readable (i.e. "proxy" is not a very good name).
Example command: rpc_factory("xmlrpc", "http://127.0.0.1:8080/RPC2")
- Example Parameters:
- type = xmlrpc
- url = http://127.0.0.1:8080/RPC2