Name Service Entry Cleanup

A name service entry should contain information that does not change frequently. For this reason, do not include dynamic endpoints in your exported binding handles because they will change at each invocation of the server and will clutter up your name service entry. To remove these binding handles, use RpcBindingReset. For example, a reasonable sequence of server operations would be:

For more than one transport:

RpcServerUseProtseq();
RpcServerUseProtseq();
 

To place bindings in the endpoint mapper:

RpcServerInqBindings(&Vector);
RpcEpRegister(Interface, Vector);
 

To remove endpoints from bindings:

for (i=0; i < Vector- > Count; + + i)
    {
    RpcBindingReset(Vector->BindingH[i];
    }
 

To add bindings to the name service:

RpcNsBindingExport(RPC_C_NS_SYNTAX_DEFAULT, EntryName, Interface
    Vector);
RpcServerListen();
 

Since the Microsoft Locator service does not use many resources to export information, the examples above work well. However, Microsoft RPC also supports Digital Equipment Corporation's Cell Directory Service (CDS), which is a more robust name service. When using CDS, RpcNsBindingExport or RpcNsBindingUnexport will create significant network traffic for replication and distribution. Thus, the server should determine if the information already has been exported and export only it if is has not.