RpcReader(3I) | InterViews Reference Manual | RpcReader(3I) |
RpcReader - read RPC requests from a client
#include <Dispatch/rpcreader.h>
An RpcReader reads RPC requests from an rpcstream which represents a connection to a client. When it reads an RPC request, it uses the request number to look up the address of a function in an array and calls that function to unmarshall the request's arguments and execute the request.
An RpcReader is not instantiable; you have to implement a derived class which initializes the function array with addresses of static member functions to unmarshall RPC requests and which defines the action to be performed when the client closes the connection. The function array looks like this:
typedef void (*PF)(RpcReader*, RpcHdr&, rpcstream&);
PF* _function;
Each function stored in the array should extract any arguments needed by the RPC request from the rpcstream, execute the RPC request, and insert any return values into the rpcstream so they can be sent back to the client.
27 March 1991 | InterViews |