CS476/576

Assignment #6

Due Midnight, Friday   Dec 7, 2001


Write a Java  program with the following descriptions:

NAME

Jtcpline - A  Java  program with a Swing interface that creates a chain of processes connected with tcp sockets.
SYNOPSIS
java Jtcpline
DESCRIPTION

     The program creates a chain of N processes  with each process connected to its neighbour with a tcp connection. The Swing interface for this program is shown in the following Figure .

Upon the creation of the the last process in the tcpline,  the last process  will send a message through the tcpline  indicating to the user to start providing  input.

Any line typed by the user in the TextLine will travel across the tcp line  to the last process and then travels back  to be displayed  in the  TextArea. Each process introduces a 1 second delay in the forward direction (from 1st to the  last process).

When the user clicks on the Quit button, the processes are terminated in the reverse order of their creation, i.e., the last Nth process dies first and the first process dies last.

The program has two arguments:

Rhost
The default value for Rhost is "localhost" which means the tcpline processes are created at the localhost. However, a user my use the combo box to select another host (e.g., pitfall) where tcpline processes are created.  In such case the Swing interface will run on localhost while the tcpline processes runs  on  pitfall ( see next figure )

Nproc
The default value is 1, but a user my use the combo box to select another value in the range from 1-8.



 
 


When the user clicks on the Go button, the program creates the  N tcpline processes locally or remotely (based on the selected value of the Rhost).

Swing GUI interface Notes:

The interface shown in the figure is just an example of what is required,
you may design your own interface but is should have the following components.

In addition, the following constraints should be observed:
  1. You should have dialogue boxes to confirm or cancel the actions of both the Go and Quit buttons.
  2. The args combo boxes and the Go button should become insensitive after the start of the program.
  3. The input text line and the Quit button should become insensitive during the execution of the three program transactions (start, line-send and end).
  4. The interface should stay on the screen for a few seconds before quitting to give a chance to the user to read the sign off message.
To get a feeling and gain more details about the specification
of this program, execute my own solution under:
/home/cs476/public_html/fall01/assignments/a6/wahab
OR   ClickHere

Example:

The  following figure   is a snapshot of using the program, where
the values of  Rhost is "localhost" and the value of Nproc is 2.
The user Quits the program after entering one line (cs476).
 



 

 

Back to Assignments Page
Back to CS476/576 Home Page