OSF DCE Application Development Guide--Core Components
Writing Internationalized RPC Applications
routine.
Note that the rpc_cs_get_tags() routine always sets the receiving tag value on the server
side to the value that the client specified in the desired receiving tag. See the
rpc_cs_get_tags(3rpc) reference page for an explanation of this routine’s signature and
function.
RPC application programmers who are developing their own tag-setting routines can also
refer to the rpc_cs_get_tags(3rpc) reference page to obtain the required signature for
their user-written routine.
The tag-setting routine generally obtains the code set tag values from the binding handle.
These values are usually determined by the character and code set evaluation routine
invoked during the server binding import process, although they can be explicitly set in
the binding handle by using the rpc_cs_binding_set_tags( ) routine. However,
applications can design the tag-setting routine to perform evaluation within the stubs
rather than in the application (client) code. For example, when called from the client
side, the DCE RPC tag-setting routine rpc_cs_get_tags( ) performs character and code
set compatibility evaluation itself if it does not find the tag values in the binding handle.
See Section 15.3.6 for more information on deferred evaluation.
15.3.4 Writing the Server Code
A programmer who is developing an RPC server that supports character and code set
interoperability needs to add the following steps to the server’s initialization functions in
addition to the normal initialization functions it carries out for RPC:
• Setting the server’s locale
• Establishing the server’s supported code sets
• Registering the server’s supported code sets in the name service database
• Establishing a cleanup function that removes the server’s supported code sets from
the name service database on the server’s termination or exit.
The next sections explain these steps in detail.
15.3.4.1 Setting the Server’s Locale
The server initialization code needs to include a platform-specific routine that sets the
locale environment for the server. This step establishes
• The name of the server’s local code set.
• The names of the code sets for which converters exist on the host and consequently,
into which processes that run on the host can convert if necessary.
An example of a locale-setting function is the POSIX, XPG3, XPG4 setlocale( ) function,
which is defined in locale.h. The server code should call the locale-setting function as
the first step in the initialization code, before calling the DCE RPC routines that register
124245 Tandem Computers Incorporated 15− 15