Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rpchdr(3i) [debian man page]

RpcHdr(3I)						    InterViews Reference Manual 						RpcHdr(3I)

NAME
RpcHdr - header for remote procedure calls SYNOPSIS
#include <Dispatch/rpchdr.h> DESCRIPTION
An RpcHdr enables an RPC request to be sent or received. To send an RPC request, you would insert an RpcHdr into an rpcstream followed by any arguments and then flush the rpcstream if you wanted the request to be sent immediately. The rpcstream automatically fills in each RPC request's length field. To receive an RPC request, you would extract an RpcHdr from an rpcstream and examine the ``request()'' member to determine which additional arguments need to be extracted as well. You can examine the ``ndata()'' member too if you need to estimate how much space to allocate. CONSTRUCTORS
RpcHdr(void* writer, int request) RpcHdr(int request) RpcHdr() Construct an initialized header for an outgoing RPC request (first two constructors) or construct an uninitialized header for an incoming RPC request (third constructor). To initialize the header, you'll have to store the request's protocol number. You can also store the address of the writer sending the RPC request if you want to route the RPC request to a specific reader on the peer's side. PUBLIC OPERATIONS
unsigned long reader() int request() unsigned int ndata() Get information about the RPC request. ``reader()'' identifies the reader which should handle the RPC request. ``request()'' iden- tifies the action that should be performed. ``ndata()'' gives the number of data bytes following the header, which may be useful for estimating the amount of space that must be allocated to store an argument. SEE ALSO
RpcReader(3I), RpcWriter(3I), rpcstream(3I) InterViews 27 March 1991 RpcHdr(3I)

Check Out this Related Man Page

RpcReader(3I)						    InterViews Reference Manual 					     RpcReader(3I)

NAME
RpcReader - read RPC requests from a client SYNOPSIS
#include <Dispatch/rpcreader.h> DESCRIPTION
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 mem- ber 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. CONSTRUCTORS
RpcReader(rpcstream* client, int nfcns) RpcReader(int fd, int nfcns, boolean binary = true) If given a non-nil rpcstream, prepare to read RPC requests from the client using it. If given a nil rpcstream, just allocate the function array. If given a file descriptor, create a new rpcstream and prepare to read RPC requests from the client using it. ``nfcns'' sets the size of the function array that each constructor allocates. PROTECTED OPERATIONS
virtual int inputReady(int) Read an RPC request (only one request per call so the program can service RPC requests from multiple connections in round robin fashion). Look up the appropriate function in the reader's or another reader's function array and call it to handle the RPC request. Return the appropriate status to tell the Dispatcher whether to detach the RpcReader, call inputReady again, or wait for new data before calling inputReady again. A derived class should not need to redefine this function. virtual RpcReader* map(unsigned long reader) You can redefine this function to change which reader executes an RPC request after it's read. Ordinarily the same reader that reads an RPC request also executes it, but you can hand the request off to another reader as well. virtual void connectionClosed(int fd) = 0 You have to define this function since it may be your only chance to perform cleanup (such as deleting this) when the client closes the connection. SEE ALSO
RpcHdr(3I), RpcService(3I), rpcstream(3I) InterViews 27 March 1991 RpcReader(3I)
Man Page