• Post Reply Bookmark Topic Watch Topic
  • New Topic

Client- Server chat application  RSS feed

sujit dash
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to develop a Chat application. It is a Client-Server application. The Chat server will listen on port #6789. It will allow upto 10 connections. i.e. upto 10 participants in the chat session. On receiving a connection request, the server will spawn a thread to service that connection's input. Any text message that the user types will be sent to all the users who are connected. This will be handled by an output thread at the server.
The client will be an applet. It will display the messages received and also let the user input the message. The message will consist of the user name and the text message that the user types.

Q : what is M-V-C design pattern ?
Q : how to Design the Java classes according to the pattern.
Q : how Thread synchronization, semaphores for access of
common data areas common to the threads.

The JAVA code
HTML to launch the client applet
Javadoc for the different modules
A paper on MVC design pattern and how to use it to design Java GUI
pl let me know details at an earliest.
Thanx in advance.
karl koch
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nice homework assignment....

MVC = Model View Controler.
Check out the Patterns forum for detailed infos.
Used to separate presentation layer from the app.
Semaphores: in java there is the synchronized keyword.
you can male either make whole methods synchronized or just a block:
public synchronized void doSomeFoo() {
// this method is fully synchronized
public void doSomeBar() {
// not synchronized
synchronized(someObject) {
// this block is synchronized
// also not snychrnized
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!