This directory contains a set of tests for the ACE_Name_Server library. There are two directories -- client and server, which test the client and server, respectively. In addition, these tests illustrate how to use the ACE Service_Config mechanism, which enables the client and server code to be dynamically linked into the process at installation-time or run-time! The client test is an application that allows the user to vary the test parameters through the following menu driven interface: Name Service Main Menu ---------------------- *** Using Process Local Database ***

Use Process Local Database Use Node Local Database Set Remote Name server and Bind [] Unbind Rebind [] Find Lookup keys matching Lookup values matching Lookup types matching Complete lookup keys matching Complete lookup values matching Complete lookup types matching or ^C (exit) Initially, the user can select the type of database -- process local, node local, or net local -- from the menu.

uses the process local database (i.e., the database is called the same name as the process and stored in /tmp). uses the node local database (which defaults to /tmp/localnames). uses the net local database by specifying host and port number (by default this is stored in a file called /tmp/globalnames on the server). The user can then create new bindings, delete existing bindings, or rebind bindings: Bind [] -- binds the key to the value and adds the binding to the database. Note that type information is optional. Unbind -- unbind a binding whose key is Rebind [] -- rebind to . Once again is optional. Find -- find the binding associated with key or ^C (exit) -- exit gracefully, saving the contents of the Name Server in persistent shared memory. In addition, the user can do pattern matching for keys, values, and types. Note that pattern matching is supported using regular expressions. Lookup keys matching -- find all keys that match Lookup values matching -- find all values that match Lookup types matching -- find all types that match Complete lookup keys matching -- find all bindings whose keys match Complete lookup values matching -- find all bindings whose values match Complete lookup types matching -- find all bindings whose types match ------------------------- Running the tests: Both the client and the server test programs use DLL supported by svc.conf which allows them to configure the client-side and the server-side (respectively) dynamically. The client test program accomplishes this by making use of a Singleton proxy object (Name_Service) to provide an interface to the client-side. The test programs rely on svc.conf to provide the necessary parameters for dynamically linking the Name Service library and then executing. In the absence of svc.conf, the test programs would use static binding. client: The client test can be started without any parameters. However, if the user wants to use the net local database, the hostname and the port number of the server containing the net local database can be given at "command line" in the svc.conf file, e.g.: dynamic ACE_Naming_Context Service_Object * libACE.so:_make_ACE_Naming_Context () "main -h tango.cs -p 7891" dynamic Name_Server_test Service_Object * .shobj/Client_Test.so:_make_Client_Test () "" The above example starts the client test application and sets up a connection to port 7891 to a Name Server running on tango.cs, which has the net local database. The Client_Test directive must come after ACE_Naming_Context since it relies on the ACE_Naming_Context having been dynamically linked. Note that you can also use environment variables in the "command line", as follows: dynamic ACE_Naming_Context Service_Object * libACE.so:_make_ACE_Naming_Context () "main -s $DB -p $PORT -h tango" dynamic Name_Server_test Service_Object * .shobj/Client_Test.so:_make_Client_Test () "" In this example, $DB and $PORT are environment variables that are automatically interpreted and substituted by ACE. In addition, note how you can give a relative name for the libACE_svcs.so and ACE will locate this for you automatically by reading your LD search path. server: The name server is needed only in the case where the net local database needs to be accessed. The server test needs to run on the machine that contains the net local database. To execute the server test, the user has to specify the port number at which the server will be listening in the svc.conf file. An implementation of a name service for ACE is available in the $WRAPPER_ROOT/netsvcs/bin directory. Please see the README file there for an explanation of how to run the server.