Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rpcstream(3i) [debian man page]

rpcstream(3I)						    InterViews Reference Manual 					     rpcstream(3I)

rpcstream - iostreamb specialized to RPC requests SYNOPSIS
#include <Dispatch/rpcstream.h> DESCRIPTION
rpcstream, irpcstream, and orpcstream specialize iostream, istream, and ostream, respectively, to RPC requests. That is, the associated streambuf will be an rpcbuf. Conversions will be formatted (that is, ASCII) so datums will need to be separated by space characters. CONSTRUCTORS
rpcstream() Construct an unopened rpcstream. PUBLIC OPERATIONS
void listen(int port) void connect(const char* host, int port) Create a connection. Any failure sets ios::failbit in the error state. int accept() Accept a pending connection and return the new file descriptor. void attach(int fd) Attach to a pre-existing connection. void close() Break a connection. The error state is cleared except on failure. void nonblocking(boolean) void verbose(boolean) Enable or disable non-blocking I/O and/or printing of error messages. rpcbuf* rdbuf() Return a pointer to the rpcbuf created by the rpcstream. boolean incomplete_request() void incomplete_request(boolean) Get or set a flag. Used by the operations that insert an RpcHdr into an rpcstream or extract an RpcHdr from an rpcstream. SEE ALSO
IOS.INTRO(3C++), iostreamb(3I), rpcbuf(3I) InterViews 27 March 1991 rpcstream(3I)

Check Out this Related Man Page

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

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

Featured Tech Videos