Class ChatServer

java.lang.Object
  |
  +--ChatServer

public class ChatServer
extends java.lang.Object

The server class for the chatroom. This class is the main driver that sets up the socket and fires a new Thread when a client connects. Internally it maintains a synchronized buffer to avoid race conditions between clients. Any incoming traffic from any client is echoed to all clients, including the originator.

To run this give the maximum number of clients and port number on the command line


Constructor Summary
ChatServer()
           
 
Method Summary
static void main(java.lang.String[] args)
          This is the driver for the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatServer

public ChatServer()
Method Detail

main

public static void main(java.lang.String[] args)
This is the driver for the server. It sets up a socket, and then fires threads for each connect.