📄 readme
字号:
This directory contains a test for the ACE_Name_Server library. Thistest program also illustrates how to use the ACE Service_Configmechanism, which enables the client code to be dynamically linked intothe process at installation-time or run-time.The client test is an application that allows the user to vary thetest parameters through the following menu driven interface: Name Service Main Menu ---------------------- *** Using Process Local Database *** <P> Use Process Local Database<N> Use Node Local Database<H> Set Remote Name server <host> and <port> <B> Bind <key> <value> [<type>]<U> Unbind <key><R> Rebind <key> <value> [<type>]<F> Find <key><J> Lookup keys matching <pattern><K> Lookup values matching <pattern><L> Lookup types matching <pattern><C> Complete lookup keys matching <pattern><D> Complete lookup values matching <pattern><E> Complete lookup types matching <pattern><Q> or ^C (exit) Initially, the user can select the type of database -- process local,node local, or net local -- from the menu.<P> uses the process local database (i.e., the database is called the same name as the process and stored in /tmp).<N> uses the node local database (which defaults to /tmp/localnames).<H> 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, orrebind bindings:<B> Bind <key> <value> [<type>] -- binds the key to the value and adds the binding to the database. Note that type information is optional.<U> Unbind <key> -- unbind a binding whose key is <key><R> Rebind <key> <value> [<type>] -- rebind <key> to <value>. Once again <type> is optional.<F> Find <key> -- find the binding associated with key <key><Q> 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, andtypes. Note that pattern matching is supported using regular expressions.<J> Lookup keys matching <pattern> -- find all keys that match <pattern><K> Lookup values matching <pattern> -- find all values that match <pattern><L> Lookup types matching <pattern> -- find all types that match <pattern><C> Complete lookup keys matching <pattern> -- find all bindings whose keys match <pattern><D> Complete lookup values matching <pattern> -- find all bindings whose values match <pattern><E> Complete lookup types matching <pattern> -- find all bindings whose types match <pattern>-------------------------Running the tests:The test program uses a DLL supported by the svc.conf file, whichallows them to configure the client-side dynamically. The client testprogram 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 parametersfor dynamically linking the Name Service library and thenexecuting. In the absence of svc.conf, the test programs would usestatic binding.client:The client test can be started without any parameters. However, if theuser wants to use the net local database, the hostname and the portnumber 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 aconnection to port 7891 to a Name Server running on tango.cs, whichhas the net local database. The Client_Test directive must come afterACE_Naming_Context since it relies on the ACE_Naming_Context havingbeen dynamically linked.Note that you can also use environment variables in the "commandline", 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 areautomatically interpreted and substituted by ACE. In addition, notehow you can give a relative name for the libACE_svcs.so and ACE willlocate this for you automatically by reading your LD search path.server:The name server is needed only in the case where the net localdatabase needs to be accessed. The server test needs to run on themachine that contains the net local database. To execute the servertest, the user has to specify the port number at which the server willbe listening in the svc.conf file. An implementation of a nameservice for ACE is available in the $ACE_ROOT/netsvcs/{lib,servers}directories. Please see the README files there for an explanation ofhow to run the server.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -