RPC -WR5441 Specifikace Strana 27

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 34
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 26
Remote Procedure Call Programming Guide Page 27
nuser(rqstp, transp)
struct svc_req *rqstp;
SVCXPRT *transp;
{
unsigned long nusers;
unsigned short nusers2;
switch (rqstp->rq_proc) {
case NULLPROC:
if (!svc_sendreply(transp, xdr_void, 0)) {
fprintf(stderr, "can’t reply to RPC call\n");
return (1);
}
return;
case RUSERSPROC_NUM:
/*
* Code here to compute the number of users
* and assign it to the variable nusers
*/
nusers2 = nusers;
switch (rqstp->rq_vers) {
case RUSERSVERS_ORIG:
if (!svc_sendreply(transp, xdr_u_long,
&nusers)) {
fprintf(stderr,"can’t reply to RPC call\n");
}
break;
case RUSERSVERS_SHORT:
if (!svc_sendreply(transp, xdr_u_short,
&nusers2)) {
fprintf(stderr,"can’t reply to RPC call\n");
}
break;
}
default:
svcerr_noproc(transp);
return;
}
}
Zobrazit stránku 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 33 34

Komentáře k této Příručce

Žádné komentáře