RPC.CALL function
Syntax
RPC.CALL (connection.ID, procedure, #args, MAT arg.list, #values,
MAT return.list)
Description
Use the RPC.CALL function to make requests of a connected server. The request is packaged and sent to the server using the C client RPC library. RPC.CALL returns the results of processing the remote request: 1 for success, 0 for failure.
connection.ID is the handle of the open server connection on which to issue the RPC request. The RPC.CONNECT function gets the connection.ID.
procedure is a string identifying the operation requested of the server.
#args is the number of elements of arg.list to pass to the RPC server.
arg.list is a two-dimensional array (matrix) containing the input arguments to pass to the RPC server. The elements of this array represent ordered pairs of values. The first value is the number of the argument to the server operation, the second value is an argument-type declarator. (Data typing generalizes the RPC interface to work with servers that are data-type sensitive.)
#values is the number of values returned by the server.
return.list is a dimensioned array containing the results of the remote operation returned by RPC.CALL. Like arg.list, the results are ordered pairs of values.
RPC.CALL builds an RPC packet from #args and arg.list. Functions in the C client RPC library transmit the packet to the server and wait for the server to respond. When a response occurs, the RPC packet is separated into its elements and stored in the array return.list.
Use the STATUS function after an RPC.CALL function is executed to determine the result of the operation, as follows:
- 81001
- Connection closed, reason unspecified.
- 81002
- connection.ID does not correspond to a valid bound connection.
- 81004
- Error occurred while trying to store an argument in the transmission packet.
- 81005
- Procedure access denied because of a mismatch of RPC versions.
- 81008
- Error occurred because of a bad parameter in arg.list.
- 81009
- Unspecified RPC error.
- 81010
- #args does not match expected argument count on remote machine.
- 81015
- Timeout occurred while waiting for response from server.
Example
The following example looks for jobs owned by fred. The server connection was made using the RPC.CONNECT function.
args (1,1) = "fred"; args (1,2) = UVRPC.STRING
IF (RPC.CALL (server.handle, "COUNT.USERS", 1, MAT
args,
return.count, MAT res)) ELSE
PRINT "COUNT.JOBS request failed, error code is: "
STATUS()
GOTO close.connection:
END