summaryrefslogtreecommitdiff
path: root/netsvcs/clients/Naming/README
blob: 7249a2b23c0381970e4ed814c1eff8173227c141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
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 ***
 
<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, or
rebind 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, and
types. 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:

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.