Robert Bach
John Bresnahan
High-Performance Computing Laboratory
Department of Computer Science
Northern Illinois University
DeKalb, IL
February 1997
This is the Nexus version of the Unix "talk" application. As such, it is a curses-based program. It is intended to be an example of how to use the Nexus "attach" functionality in a client/server application.There are three source files in this example, talk_server.c, talk_client.c, and display.c. An effort has been made to hide all the curses implementation details in display.c and display.h.
The server in this example is designed to service exactly one client. Once that connection has been established, no other clients may attach to this server. Further, once the client/server connection has been established and the session runs to completion, upon disconnecting BOTH the server and the client terminate.
This is unlike traditional client/server applications where a server my service a number of clients simultaneously and where the server does not terminate after servicing exactly one client. But, this is an example whose purpose is to demonstrate the Nexus attach and detach functionality. Extending this example to allow multiple clients and establish an omnipresent server should be straightforward.
This program will if linked against a version of Nexus. Edit Makefile and change NEXUS_DIR to the name of the directory where you installed Nexus. This will be the directory you specified with the --prefix= switch when configuring Nexus. It is the directory that gets populated when you 'make install' Nexus.
In order for this program to work properly, this must be a non-lite (full) version of Nexus. Also, you *might* have to change the name of the curses libraries in the Makefile.
There are two separate programs that need to be made, talk_server and talk_client. To make both simply:
make all
You must first run the talk_server and then run the talk_client.running talk_server
To start the talk server simply typetalk_server
This will start the talk server. It will display a "welcome" screen on which it will tell you the URL that it's waiting for a talk client to attach to. It should look something like this: x-nexus://olympus:44313/
running talk_client
The talk server also writes this URL to /tmp/talk_url. If the machine you plan to execute the talk client has access to that file, then you may simply execute the talk client by typing.
talk_client
On the other hand, if the machine you plan to execute the talk client does not have access to the /tmp/talk_url created by the talk server (e.g., executing the talk client on a remote machine), then you may pass the URL as a command line argument. For example, using the attach URL shown above:
talk_client -a x-nexus://olympus:44313/
This will initiate your talk session.
The talk session is terminated when either side enters control-x.
A curses-based talk session.