Goals A project that will: Project 2 Have multiple threads - - PDF document

goals
SMART_READER_LITE
LIVE PREVIEW

Goals A project that will: Project 2 Have multiple threads - - PDF document

Goals A project that will: Project 2 Have multiple threads Have a GUI Involve networking The Chat Room Be a lot of fun. Handles Windows People willing to enter the chat room must Your program should display 2


slide-1
SLIDE 1

Project 2

The Chat Room

Goals

  • A project that will:

– Have multiple threads – Have a GUI – Involve networking – Be a lot of fun.

Handles

  • People willing to enter the chat room must

have a handle

– Handle is a unique string identifying user

Windows

  • Your program should display 2 types of

windows:

– User List – list of handles of all people registered with the chat room. – Conversation Window – where conversations take place

  • May be multiple conversations up at any one time.

Ground Rules

1. When program is started, user list window should appear. 2. Program must define a simple way to start a conversation with a user 3. User must be notified when someone wants to start a conversation. User may

1. Accept the call 2. Deny the call 3. Ignore the call

Ground Rules

  • 4. If user accepts, conversation window

should appear where user sees what he/she as well as the other party types.

  • 5. A conversation can be terminated from the

conversation window 6.There must be a graceful way to exit the program.

slide-2
SLIDE 2

Ground Rules

  • Program must be able to manage user list

window and all conversation windows, as well as placing / accepting calls. at the same time

– Hmm…perhaps each one running in its own thread?

  • Questions so far?

Specs

  • To invoke the chat client, use the command

– java CS3Chat myhandle – myhandle is the name chosen by the user.

  • Note, all CS3 students will connect to the same

name server. If myhandle is already used:

– myhandle is already in use

  • Bad commandline?

– Usage: java CS3Chat myhandle

Design note

  • The GUI must be built by hand.
  • Please do not use a GUI Building tool (e.g.

Forte, Jbuilder, or Visual J++)

3 Parts to the chat system

  • Name Server

– Allows users to register and find others registered. – Name server will be shared amongst all CS3 Sections

  • Chat Server (interface)

– Communicates with name server – Initiates chat sessions – Notifies of chat requests via a Listener.

  • Applications register a listener to get noifications.
  • Chat Application

– Chat client – What you will be writing

Classes that will be provided

  • NetworkChatServer

– Implements ChatServer – Provides access to common name server.

  • ChatListener (interface)

– Can register with the NetworkChatServer to receive chat events

  • ChatSession

– Object used to manage communication between 2 users. – Uses Reader and Writer for I/O communication – Closing ChatSession will close Reader / Writer

Classes that will be provided

  • ChatException

– Exception thrown if chat goes wrong

  • You will have to write the ChatApplication,

namely CS3Chat.

  • Questions?
slide-3
SLIDE 3

Register with the server Initiate a conversation Accept an invite to converse Questions? Deliverables

  • Minimum submission

– CSChat will:

  • Register a handle with the name server
  • Display a user list
  • Update list base on info received by name server

– Due 11/6

Deliverables

  • Final Submission

– CSChat will

  • Provide ability to initiate a conversation
  • To accept / deny a chat request
  • Maintain multiple conversation windows

– Due 11/13 – Note: you will be responsible for GUI and Interaction Design

slide-4
SLIDE 4

Grading

  • 85 points – program functionality
  • 15 points – GUI design
  • -20 points – bad implementation / design
  • -20 points – Style violations (including

RCS)