Group: | Remote Procedure Call |
See also: | rpclink rpcstartclient rpcstartserver rpcstarttimer rpcstopclient rpcstopserver rpcstoptimer systemcall |
Function: | rpcsendrequest | |
Description: | rpcsendrequest sends a request to a given client. |
Usage: | retstr = rpcsendrequest (handle, functionnr, requstr, timeout) | |
Input: | ||
handle | scalar | |
functionnr | scalar | |
requstr | string | |
timeout | scalar | |
Output: | ||
retstr | string |
rpcstartserver ("0x43000000") rpcstarttimer (100, 0, "XGobiTimer") ; systemcall ("$XGOBIDIR/bin/xgobi -server 0x43000000 -client 0x42000000 -link xplore &") systemcall ("sleep 5") ; xg1 = rpcstartclient ("0x42000000") ; rpcsendrequest (xg1, 11, "xplore 2 3", 10) rpcsendrequest (xg1, 12, "1 2 3 4 5 6", 10) rpcsendrequest (xg1, 13, "1203 2102 3304", 10) rpcsendrequest (xg1, 14, "", 10)
Activates the XploRe RPC mechanism (server and client) and starts up XGobi as a client (with three plotted symbols). Later, both programs can send RPC requests to each other. In this example, we pass the name and dimensionality of a xplore matrix to XGobi (functionnr 11), pass the data (functionnr 12), pass the brushing information (functionnr 13), and request XGobi to display this data (functionnr 14). Given that every call to XGobi succeeds, you should see the following output in the XploRe_out window. In the communication with XGobi, the result of rpcsendrequest is the functionnr plus the digits 00 if everything is OK and two digits greater than 00 if an error occurs: Content of object _tmp [1,] 11.00 Content of object _tmp [1,] 12.00 Content of object _tmp [1,] 13.00 Content of object _tmp [1,] 14.00
Group: | Remote Procedure Call |
See also: | rpclink rpcstartclient rpcstartserver rpcstarttimer rpcstopclient rpcstopserver rpcstoptimer systemcall |