CS202 Site Index
- Main
- Information
- Registration
- Announcements
- Lectures
- Assignments
- Submit
- View
- Reference
- Passwords
Java logo CS202 - Fall 1999
Transition to Java

Assignment 3

divider line

Updates


Due date
Friday, 24 September 1999 at 12:20pm.

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 create the classes: JavlleClient, JavlleServer and JavlleServerHandler and their respective .java files. To start the server and two clients all at once type: "java a3test".

Submission
Before the assignment deadline you are expected to sumbit one file into your A3 directory:

Make sure your program works with the supplied driver code.

Attachments  
swingall.jar a3test.java Piece.java WildcardPiece.java Board.java BoardView.java IMAGES.bin

Good luck.
divider line
Copyright 1999, Rimon Barr, Cornell University RB f99-cs202: a.3.html (6488)