hi all!
i really need ur help
i have a project and have no time .i'll write down the program that i need help with:
:
!Lets assume that on a specific time, three buddies (Charles, Lee, and Martin_X) are involved in chatting; see figure-1. Of course, these three buddies are running Chat Client programs on their PCs. The Chat Server program may run in any one of these PCs, or on a separate PC. In figure-1, the chat server runs on a separate PC. Lets assume that the client programs know the IP address of the PC that is running the server program, and the port number through which the chat services are offered. Lets also assume that server is always running (server is never stopped).
1. Starting the Chat Client program
Suppose Charles and Martin_X are already chatting. If Lee wants to join then he must start the client program on his PC. He must also give his nickname as a command-line parameter. For example:
> java ChatClient Lee
If the command-line parameter is not given, then the client program asks for a nickname first. See figure-2. After reading the nickname, the client program contacts the server and sends the nickname to it.
2. Client – Server interaction
If the server is up and running, and there is no communication problems, then the chat client creates a GUI for the user (Lee). GUI is shown in figure-3. Note the following:
• The caption of the GUI is “***** its:Chatting *****”.
• The first panel of the frame is a text area for displaying the messages. Important: the text area shown in figure-3 does not posses scroll bar. You implementation must have vertical and horizontal scroll bars.
• The second panel of the frame is the user input area. The first component is a label showing the nickname of the user (‘Lee’ is figure-3). The second component is a text field for user input.
• The user enters his message in the text field. After writing the message, he presses the “Send” button. The message is then sent to the server; in addition, the text field is cleared.
• The server echoes the message to every one, including the sender. Of course, the server adds the sender’s nickname in capital letters in front of the message; see figure-3.
• If a user want to quit, he simply presses the “Exit” button. In this case, the client first sends a string “quit” to the server so that the server can echo it to everyone. Then the client disconnects the link to the server and finally, it exits.
3. The Server
• The server uses port number 1234 (you are free to choose any other port number).
• Whenever a client contacts for the first time, the server places and the client’s IP address together with the supplied nickname in an array. The server uses this array to echo messages to all the participants. As shown in figure-3, the echoed messages contain the sender’s nickname (in capital letters) as the prefix.
• Server writes all the echoed messages to an ASCII file too. When a message is received right after mid-night, the ASCII file is written (‘dumped’) to hard disk with filename ‘archive_N.txt’, where N is the day of the year (0 – 365).
plz if anyone can help me,write me what should i do,and other tips......
nb:reply as soon as possible.
thanx alot
Suha