DCE for the HP e3000 (B3821-90003)
56 Chapter7
Programming with RPC 1.2.1 on MPE/iX
void main(int argc, char *argv[])
{
rpc_binding_handle_tbh; /* "points" to the server */
error_status_t st, _ignore; /* returned by DCE calls */
dce_error_string_t dce_err_string; /* text describing error code */
ndr_char *string_binding; /* used to create binding */
unsigned long sleep_time; /* seconds server will sleep */
unsigned_char_t *netaddr; /* network address of server */
#ifdef TRACING
/* tr_init() --
*
* The tr_init call initializes the trace facility. The first parameter
* is the name of an environment variable to consult to determine the
* values for the selector levels, output filename, etc. These values
* can have defaults assigned in the second and third parameters, but
* this sample application does not choose to do this. The trace_name
* parameter is a prefix string that will appear on each line of output
* to distinguish tracing from this application from other applications.
*/
if (tr_handle == NULL) {
tr_handle = tr_init("TR_SLEEPER", /* environment variable name */
NULL, /* selector level defaults */
NULL, /* filename for output */
trace_name); /* prefix string in output */
if (tr_handle == NULL) {
/*
* Still NULL -- unable to initialize tracing. This may cause
* the following tr_printmsg calls (via PRINT_FUNC) to fail.
*/
fprintf(stderr, "Unable to initialize tracing interface!\n");
}
}
#endif /* TRACING */
if (argc != 3) {
ifprintf(stderr, "Usage: %s hostname sleep_time\n", argv[0]);
exit(1);
} else {