15 dispatch(struct svc_req
*request
, SVCXPRT
*xprt
)
17 svc_sendreply(xprt
, (xdrproc_t
)xdr_void
, 0);
21 test_one_call (CLIENT
*c
)
23 struct timeval tout
= { 60, 0 };
24 enum clnt_stat result
;
26 printf ("test_one_call: ");
27 result
= clnt_call (c
, PROCNUM
,
28 (xdrproc_t
) xdr_void
, 0,
29 (xdrproc_t
) xdr_void
, 0, tout
);
30 if (result
== RPC_SUCCESS
)
41 thread_wrapper (void *arg
)
43 test_one_call ((CLIENT
*)arg
);
55 struct sockaddr_in sin
;
56 struct timeval wait
= { 5, 0 };
57 int sock
= RPC_ANYSOCK
;
59 svx
= svcudp_create (RPC_ANYSOCK
);
60 svc_register (svx
, PROGNUM
, VERSNUM
, dispatch
, 0);
71 inet_aton ("127.0.0.1", &sin
.sin_addr
);
72 sin
.sin_port
= htons (svx
->xp_port
);
73 sin
.sin_family
= AF_INET
;
75 clnt
= clntudp_create (&sin
, PROGNUM
, VERSNUM
, wait
, &sock
);
77 /* Test in this thread */
80 /* Test in a child thread */
81 err
= pthread_create (&tid
, 0, thread_wrapper
, (void *) clnt
);
83 fprintf (stderr
, "pthread_create: %s\n", strerror (err
));
84 err
= pthread_join (tid
, 0);
86 fprintf (stderr
, "pthread_join: %s\n", strerror (err
));