RPC -WR5441 Dokumentacja Strona 27

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 34
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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;
}
}
Przeglądanie stron 26
1 2 ... 22 23 24 25 26 27 28 29 30 31 32 33 34

Komentarze do niniejszej Instrukcji

Brak uwag