
Remote Procedure Call Programming GuideThis document assumes a working knowledge of network theory. It is intended for programmers who wishto write ne
Page 10 Remote Procedure Call Programming Guide3.1. More on the Server SideThe server for the nusers() program shown below does the same thing as the
Remote Procedure Call Programming Guide Page 11First, the server gets a transport handle, which is used for receiving and replying to RPC messages. re
Page 12 Remote Procedure Call Programming GuideThe relevant routine is svc_getargs() which takes an SVCXPRT handle, the XDR routine, and a pointer tow
Remote Procedure Call Programming Guide Page 13simple examples like those in this section, a user doesn’t hav e to worry about the three modes. See th
Page 14 Remote Procedure Call Programming Guide3.3. The Calling SideWhen you use callrpc() you have no control over the RPC delivery mechanism or the
Remote Procedure Call Programming Guide Page 15argument, a pointer to the argument, the XDR routine for deserializing the return value, a pointer to w
Page 16 Remote Procedure Call Programming Guide4. Other RPC FeaturesThis section discusses some other aspects of RPC that are occasionally useful.4.1.
Remote Procedure Call Programming Guide Page 174.2.1. Broadcast RPC Synopsis#include <rpc/pmap_clnt.h>...enum clnt_stat clnt_stat;...clnt_stat
Page 18 Remote Procedure Call Programming Guide#include <stdio.h>#include <rpc/rpc.h>#include <suntool/windows.h>void windowdispatch
Remote Procedure Call Programming Guide Page 19fprintf(stderr, "can’t decode arguments\n");/** We are silent in the face of protocol errors*
Page 2 Remote Procedure Call Programming Guide1.1. The RPC ParadigmHere is a diagram of the RPC paradigm:Figure 1-1 Network Communication with the Rem
Page 20 Remote Procedure Call Programming GuideHere is an example of a client that uses batching to render a bunch of strings; the batching is flushed
Remote Procedure Call Programming Guide Page 214.4. AuthenticationIn the examples presented so far, the caller never identified itself to the server, a
Page 22 Remote Procedure Call Programming Guide/** An RPC Service request*/struct svc_req {u_long rq_prog; /* service program number */u_long rq_vers;
Remote Procedure Call Programming Guide Page 23nuser(rqstp, transp)struct svc_req *rqstp;SVCXPRT *transp;{struct authunix_parms *unix_cred;int uid;uns
Page 24 Remote Procedure Call Programming Guidecall the service primitive svcerr_systemerr() instead.The last point underscores the relation between t
Remote Procedure Call Programming Guide Page 25The final argument to authdes_create() is the address of a DES encryption key to use for encrypting time
Page 26 Remote Procedure Call Programming Guide4.6. Using InetdAn RPC server can be started from inetd The only difference from the usual code is that
Remote Procedure Call Programming Guide Page 27nuser(rqstp, transp)struct svc_req *rqstp;SVCXPRT *transp;{unsigned long nusers;unsigned short nusers2;
Page 28 Remote Procedure Call Programming Guide5.2. TCPHere is an example that is essentially rcp. The initiator of the RPC snd call takes its standar
Remote Procedure Call Programming Guide Page 29/** The sender routines*/#include <stdio.h>#include <netdb.h>#include <rpc/rpc.h>#inc
Remote Procedure Call Programming Guide Page 32. Higher Layers of RPC2.1. Highest LayerImagine you’re writing a program that needs to know how many u
Page 30 Remote Procedure Call Programming Guidereturn (int)clnt_stat;}/** The receiving routines*/#include <stdio.h>#include <rpc/rpc.h>ma
Remote Procedure Call Programming Guide Page 315.3. Callback ProceduresOccasionally, it is useful to have a server become a client, and make an RPC ca
Page 32 Remote Procedure Call Programming Guide#include <stdio.h>#include <rpc/rpc.h>#include <sys/socket.h>gettransient(proto, vers
Remote Procedure Call Programming Guide Page 33The following pair of programs illustrate how to use the gettransient() routine. The client makes an R
Page 34 Remote Procedure Call Programming Guidefprintf(stderr, "client got callback\n");if (!svc_sendreply(transp, xdr_void, 0)) {fprintf(st
Page 4 Remote Procedure Call Programming Guide2.2. Intermediate LayerThe simplest interface, which explicitly makes RPC calls, uses the functions call
Remote Procedure Call Programming Guide Page 5discussed later in this document. The remote server procedure corresponding to the above might look like
Page 6 Remote Procedure Call Programming Guide2.3. Assigning Program NumbersProgram numbers are assigned in groups of 0x20000000 according to the foll
Remote Procedure Call Programming Guide Page 7RPC Number Program Description100020 LOCKPROG local lock manager100021 NETLOCKPROG network lock manager
Page 8 Remote Procedure Call Programming Guidethen you would call callrpc() ascallrpc(hostname, PROGNUM, VERSNUM, PROCNUM,xdr_simple, &simple ...)
Remote Procedure Call Programming Guide Page 9If the size of the array is known in advance, one can use xdr_vector(), which serializes fixed-length arr
Komentarze do niniejszej Instrukcji