Client-Server Whiteboard Application

1308445348|%A, %e %B %Y, %H:%M

Continuing on from what I knew just three weeks ago, I'd like to show you what I've achieved since then. This was an assignment that I handed up several days ago.

It is a whiteboard application… without the whiteboard ;-) It's designed exactly according to the assignment specification, so I want to modify it later (now that it's been handed up) to work with an actual drawing board.

Description

Connecting to the server

java Client [host] [post] [username]

To start the client, I need to provide a host (e.g. localhost or 216.239.51.99) and a port number (anything above 1024, as ports below that number are reserved by the system).

Assuming that the server is already running on that host and port number, the client will connect, and the server will send back a message beginning with "WELCOME".

Sending draw messages

DRAW [x1] [y1] [x2] [y2] [colour]

The idea with the DRAW command is that you provide a series of coordinates that can be used by a whiteboard application to draw a rectangle on the screen of each client (top-left corner at (x1, y1) and bottom-right corner at (x2, y2)).

Once this command has been sent to the server, the server checks that it is valid (coordinates within range, colour is a valid colour) and then sends back a DRAWMSG command to all connected and logged in clients.

Essentially, one client attempts to draw on the screen. If the attempt to draw is accepted by the server, then all clients (including the one that sent the message) will see a rectangle appear on the screen at those coordinates.

Video


Leave a comment

Add a New Comment
or Sign in as Wikidot user
(will not be published)
- +
Page tags: java
Please read the Legal Guidelines which covers all content found on this page.