Changing Time Outs

When using the clnt_create subroutine, RPC sets a default time out of 25 seconds for remote procedure calls.

The time-out default can be changed using the clnt_control subroutine. The following code fragment illustrates the use of this routine:

struct timeval tv
CLIENT *cl;
cl=clnt_create("somehost", SOMEPROG, SOMEVERS, "tcp");
if (cl=NULL) {
  exit(1);
}
tv.tv_sec=60; /* change timeout to 1 minute */
tv.tv_usec=0;
clnt_control(cl, CLSET_TIMEOUT, &tv);