![]() |
![]() |
|
|
Using Stub Support Functions
There are a large number of run-time support functions (over 100) defined in the X/OPEN RPC specification. These functions need not all be supported in an X/OPEN TxRPC IDL-only environment. Most of these functions relate to binding and management which are done transparently for ATMI clients and servers.
One area that affects application portability is the management of memory allocated for stub input and output parameters and return values. The Stub Memory Management routines are supported in TxRPC run time with the exception of the two routines to handle threads. The status-returning functions include:
The equivalent exception-returning functions include:
Refer to BEA Tuxedo C Function Reference for more information on these functions.
The run-time functions are contained in libtrpc; building RPC clients and servers is discussed in the next topic.
The following are a few tips regarding memory management:
rpc_ss_set_client_alloc_free(rpc_ss_allocate, rpc_ss_free);
ptr = remote_call_returns_pointer();
/* use returned pointer here */
...
rpc_ss_disable_allocate(); /* this frees ptr */
rpc_ss_set_client_alloc_free(rpc_ss_allocate, rpc_ss_free);
long *ptr;
ptr = (long *)rpc_ss_allocate(sizeof(long));
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|