DCE for the HP e3000 (B3821-90003)
Chapter 7 59
Programming with RPC 1.2.1 on MPE/iX
/*
* At this point the application is not actually connected to any
* server, but it has all the information needed to establish a
* connection to the remote server. Connection establishment happens in
* the client stub function called below.
*/
PRINT_FUNC(PRINT_HANDLE, "Bound to %s\n", string_binding);
/* rpc_string_free() --
*
* Free a string allocated by the RPC runtime. The first parameter is
* the address of a string which was previously allocated (or is NULL).
* It will be free()d, and the space returned to the system for use in
* the future. The second parameter is the DCE return status.
*/
rpc_string_free(&string_binding, /* DCE string to free */
&_ignore); /* DCE return status */
PRINT_FUNC(PRINT_HANDLE, "Calling remote_sleep(%d)\n", sleep_time);
/* TRY --
*
* The macro TRY is used to wrap a call which may result in a DCE
* exception being raised. Any call to an RPC client stub can result in
* an exception being raised if something goes wrong. Examples of what
* can go wrong include: there is no server listening on the remote
* host; there is a data error in a client or server stub; the server
* raises an exception while executing the procedure call. If an
* exception is raised and there is no TRY/CATCH block surrounding the
* call, the exception will cause the process to abort and dump core.
* Since this is typically not very helpful, we prefer to catch the
* exception. In the string_conv and later sample applications the
* client will do something intelligent with the exception.
*/
TRY {
/*
* Call the remote procedure passing in the number of seconds to sleep,
* as defined in the .idl file. A binding handle parameter is required