3 This is a simple chat application that uses the TAO CORBA ORB. It
4 consists of a client and server programs. The server broadcasts
5 messages from one client to all the clients registered with it. The
6 client(s) register with a running server. It has a very simple user
7 interface that accepts strings from the user and sends it across to
8 the server. The client code also demonstrates the use of the
9 ACE_Event_Handlerclass to accept user input events.
14 server [-o <ior_output_file>]
18 -o Outputs the server ior to the file specified.
20 On successfull initialization, the server displays a message that it
21 is running and waits for clients to register with it. If the [-o
22 <ior_output_file>] option is not specified on the command line then
23 the the server will write the IOR of the server CORBA object to a
24 default file - "chat.ior".
26 Passing the Server IOR to Clients:
27 ---------------------------------
29 To keep this example simple, the server advertises its IOR in the
30 following manner - The server program writes its server object's IOR
31 to a ior_file. Later on, the client reads this IOR from the specified
32 ior_file and uses the <string_to_object> method to obtain a reference
35 For this mechanism to work, the file must be readable and writable. If
36 it doesn't exist, a new file is created by the server. Moreover, the
37 file path must be accessible to both the client and server.
39 If the client and server are on different machine, then there must be
40 a shared directory accessible by both. On UNIX system's this is
41 typically done via the NFS mount command. On Windows, the 'explorer'
42 application provides an option to share drives.
44 In general if no such file sharing option is available, then using the
45 the Naming Service mechanism is the only alternative. To preserve its
46 simplicity, this example does not provide the feature to use a Naming
47 Service. An example of such a use is $TAO_ROOT/examples/Event_Comm/.
52 client [-n <your_nick_name> -f <ior_input_file>]
56 -n The nickname that the chat user wants to use.
57 -f Reads the server ior from the file
59 The nickname specified by the user is displayed by the chat server to
60 all the clients. To quit the chat, type "quit".
62 If the [-f <ior_input_file>] option is not specified on the command
63 line then the client will attempt to read the IOR of the server CORBA
64 object from the default file - "chat.ior".
68 On VxWorks, it's easiest to run the client without any command
69 line options. That way, its stdin can be captured:
72 value = 400826292 = 0x17e41fb4
75 Running chat server...
77 value = 399329360 = 0x17cd4850
80 using defaults. nickname = noname, filename = chat.ior
82 ============= Simple Chat =================
83 ========== type 'quit' to exit ===========
84 : **** noname has joined the chat ****
95 NOTE: if you built your VxWorks executables with g++, replace "main"
96 with "ace_main" above. See ACE-INSTALL.html for an explanation of why
97 ACE renames "main" to "ace_main" with g++ on VxWorks.