CS202 - Spring 2000

Assignment 2

Updates


Due date
Friday, 18 February 2000 at 7:00pm.

Advice


Goal
In this assignment we will be hooking up our client boards together via a server. This will allow players to play Javlle on different machines across the network.


Client
On startup the client will create a new board and display the user interface. Additionally, our client will open a connection to the server and listen for messages. Each message is separated by a newline character, and is simply a board string. Upon receiving a message from the server, the client will update the board, thereby updating also the display. When the "Go" button is clicked the current board is sent to the server. If there is a communication error, the client just quits. A client can be initiated by typing "java a3testClient".

Server
The server is a "broadcast proxy". It starts up and waits for connections from clients. Internally, it stores the current board, which is the last board it has been sent by any client. The initial board is empty. When a connection is accepted, a handler is spawned off to take care of it. Multiple simultaneous connections should be possible. Upon connection the server sends the newly connected client the current board. Also, the board is sent to all connected clients (broadcast) whenever the board changes. If a communication error occurs with any given client, the handler should terminate quietly, yet the server should continue to run, and other connections remain unaffected. A server can be initiated by typing "java a3testServer".

Guide to solving assignment
JavlleClient: Provides the functionality required for client to communicate with server.

JavlleServer: Listens for new connections and spawns handler threads. JavlleServerHandler: Handles individual client connections. Hint: Reuse the Observer model of the previous assignment to propagate data among the handlers.

Code
You are required to complete the classes: JavlleClient, JavlleServer and JavlleServerHandler and their respective .java files. To start the server and two clients all at once type: "java a3test".

You must implement the following methods:

Submission
Before the assignment deadline you are expected to submit one zip file including:

Submit code files in a zip file with a text document of comments to: ns48@cornell.edu by Friday, 7:00 PM.

Make sure your program works with the supplied driver code.

Attachments  
a3test.java Piece.java WildcardPiece.java Board.java BoardView.java

JavlleClient.java JavlleServer.java JavlleServerHandler.java IMAGES.bin

Good luck.

Last Updated: Sunday, February 13, 2000 03:10:10 PM