How to develope chat application using networks..

Hi friends this is my first message to java forums,I am trying to develope a chat application using J2EE and networks..I don't have the base idea where to start with....Can anybody help me please...?
[235 byte] By [Prabhu_Coimbatorea] at [2007-11-27 0:36:54]
# 1

I did this about 6 years ago so there may be a better way to do it these days. But I created a ServerSocket with an associated thread to catch incoming client requests. I created a kind of ad hoc protocol that was something like the first 3 characters of data a client sends would instruct the server and client on how to how to handle the data that followed (like PM, posting message, change chat rooms, etc.) with a special char to indicate the end of a character.

The server maintains a list of current client connections and each client connection can has a state set such as which chat room the user is currently in or if they are AFK or whatever feature you choose to implement. This list is used to know who to send messages to and whatever.

Remember to make everything thread safe as once more then a few people enter the chat there can be quite a few threads flying around.

Again this is just kind of throwing something together and what I created was far from a polished application. But hopefully it'll give you some idea's on how to proceed.

luchadora at 2007-7-11 22:46:35 > top of Java-index,Core,Core APIs...
# 2
errr... I hope I'm not asking a question too stupid but, how does that utilize J2EE?
jadespirita at 2007-7-11 22:46:35 > top of Java-index,Core,Core APIs...