|
|
After sending a request to the server, a client program waits for a default amount of time (25 seconds) to receive a reply. This timeout may be changed using the clnt_control routine. (See rpc(3rpc).)
This is a small code fragment to illustrate the use of clnt_control:
struct timeval tv; CLIENT *cl;cl = clnt_create("somehost", SOMEPROG, SOMEVERS, "visible"); if (cl == NULL) { exit(1); } tv.tv_sec = 60; /* change timeout to 1 minute */ tv.tv_usec = 0; clnt_control(cl, CLSET_TIMEOUT, &tv);