rpc_ns_mgmt_handle_set_exp_age(3rpc)Sets a handle's expiration age for local copies of name service data Used by client, server, or management applications. Synopsis #include <dce/rpc.h> void rpc_ns_mgmt_handle_set_exp_age( rpc_ns_handle_t ns_handle, unsigned32 expiration_age, unsigned32 *status); Parameters Input
ns_handle
expiration_age An expiration age of 0 (zero) causes an immediate update of the local name service data. Output
status
Description Normally, avoid using this routine; instead, rely on the application's global expiration age. A handle's expiration age is used exclusively by RPC NSI next operations (which read data from name service attributes). A next operation normally starts by looking for a local copy of the attribute data being requested by an application. In the absence of a local copy, the next operation creates one with fresh attribute data from the name service database. If a local copy already exists, the operation compares its actual age to the expiration age being used by the application (which in this case is the expiration age set for the name service handle). If the actual age exceeds the handle's expiration age, the operation automatically tries to update the local copy with fresh attribute data. If updating is impossible, the old local data remains in place and the next operation fails, returning the rpc_s_name_service_unavailable status code. The scope of a handle's expiration age is a single series of RPC NSI next operations. The rpc_ns_mgmt_handle_set_exp_age( ) routine operates as follows: 1. An RPC NSI begin operation, such as the one performed by rpc_ns_group_mbr_inq_begin( ), creates a name service handle. 2. A call to rpc_ns_mgmt_handle_set_exp_age( ) creates an expiration age for the handle. 3. A series of corresponding RPC NSI next operations for the name service handle uses the handle's expiration age. 4 A corresponding RPC NSI done operation for the name service handle deletes both the handle and its expiration age.
Permissions Required
Cautions Setting the handle's expiration age to a small value causes the RPC NSI next operations to frequently update local data for any name service attribute requested by your application. For example, setting the expiration age to 0 (zero) forces the next operation to update local data for the name service attribute requested by your application. Therefore, setting a small expiration age for a name service handle can create performance problems for your application. Also, if your application is using a remote server with the name service database, a small expiration age can adversely affect network performance for all applications. Limit the use of this routine to the following types of situations: · When you must always get accurate name service data. For example, during management operations to update a profile, you may need to always see the profile's current contents. In this case, before beginning to inquire about a profile, your application must call rpc_ns_mgmt_handle_set_exp_age( ) and specify 0 (zero) for the expiration_age parameter. · When a request using the default expiration age fails, and your application needs to retry the operation. For example, a client application using import must first try to obtain bindings using the application's default expiration age. However, sometimes the import-next operation returns either no binding handles or an insufficient number of them. In this case, the client can retry the import operation and, after rpc_ns_binding_import_begin( ) terminates, include a rpc_ns_mgmt_handle_set_exp_age( ) routine that specifies 0 (zero) for the expiration_age parameter. When the client calls the import-next routine again, the small expiration age for the name service handle causes the import-next operation to update the local attribute data.
Return Values Errors The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.
rpc_s_ok
rpc_s_invalid_ns_handle
Related Information rpc_ns_binding_lookup_begin(3rpc) rpc_ns_entry_object_inq_begin(3rpc) rpc_ns_group_mbr_inq_begin(3rpc) rpc_ns_profile_elt_inq_begin(3rpc)
|