NAME rpc_server_register_if - Registers an interface with the RPC runtime Used by server applications. SYNOPSIS #include <dce/rpc.h> void rpc_server_register_if( rpc_if_handle_t if_handle, uuid_t *mgr_type_uuid, rpc_mgr_epv_t mgr_epv, unsigned32 *status ); PARAMETERS Input if_handle An IDL-generated data structure specifying the interface to register. mgr_type_uuid Specifies a type UUID to associate with the mgr_epv parameter. Specifying the value NULL (or a nil UUID) registers the if_handle with a nil type UUID. mgr_epv Specifies the manager routines' entry point vector. To use the IDL-generated default entry point vector, specify NULL. Output status Returns the status code from this routine. This status code indicates whether the routine completed successfully or, if not, why not. The possible status codes and their meanings are as follows: rpc_s_ok Success. rpc_s_type_already_registered An interface with the given type of UUID is already registered. DESCRIPTION The rpc_server_register_if() routine registers a server interface with the RPC runtime. A server can register an unlimited number of interfaces. Once registered, an interface is available to clients through any binding handle of the server, provided that the binding handle is compatible for the client. A server must provide the following information to register an interface: + An interface specification, which is a data structure generated by the IDL compiler. The server specifies the interface specification of the interface using the if_handle parameter. + A type UUID and manager Entry Point Vector (EPV), a data pair that determines which manager routine executes when a server receives a remote procedure call request from a client. The server specifies the type UUID and EPV using the mgr_type_uuid and mgr_epv parameters, respectively. Note that when a non-nil type UUID is specified, the server must also call the rpc_object_set_type() routine to register objects of this non-nil type. A server that only offers a single manager for an interface calls rpc_server_register_if() once for that interface. In the simple case where the single manager's entry point names are the same as the operation names in the IDL interface definition, the IDL-generated default manager EPV for the interface may be used. The value NULL in mgr_epv specifies the default manager EPV. Note that if a server offers multiple implementations of an interface, the server code must register a separate manager entry point vector for each interface implementation. Rules for Invoking Manager Routines The RPC runtime dispatches an incoming remote procedure call to a manager that offers the requested RPC interface. When multiple managers are registered for an interface, the RPC runtime must select one of them. To select a manager, the RPC runtime uses the object UUID specified by the call's binding handle. The following table summarizes the rules applied for invoking manager routines. Rules for Invoking Manager Routines _______________________________________________________________________ Object Has Server Has Server UUID Set Type of Set Type for of Call¹ Object UUID?² Manager EPV³ Dispatching Action _______________________________________________________________________ Nil Not applicable(4) Yes Uses the manager with the nil type UUID. Nil Not applicable(4) No Error (rpc_s_unknown_mgr_type). Rejects the remote procedure call. Non-nil Yes Yes Uses the manager with the same type UUID. Non-nil No Ignored Uses the manager with the nil type UUID. If no manager with the nil type UUID, error (rpc_s_unknown_mgr_type). Rejects the remote procedure call. Non-nil Yes No Error (rpc_s_unknown_mgr_type). Rejects the remote procedure call. ¹ This is the object UUID found in a binding handle for a remote procedure. ² By calling rpc_object_set_type() to specify the type UUID for an object. ³ By calling rpc_server_register_if() using the same type UUID. 4 The nil object UUID is always automatically assigned the nil type UUID. It is illegal to specify a nil object UUID in rpc_object_set_type(). For more information about registering server interfaces and invoking manager routines, refer to the OSF DCE Application Development Guide. RETURN VALUES No value is returned. RELATED INFORMATION Functions: rpc_binding_set_object rpc_ep_register rpc_ep_register_no_replace rpc_ns_binding_export rpc_object_set_type rpc_server_unregister_if Books: OSF DCE Application Development Guide.