Java Multi-Client Instant Messenger concept help -


I am trying to implement a Java chat program. In this program, many customers will talk to each other from one server. The server will relay another message from the client. It will also provide updates to a friend's list. The best way to implement this IM chat is to estimate the part with which I'm having trouble, sending the server from one client to another. Each customer should be able to choose whom they want to talk to. Once again, the only purpose of the server is to get a message from a customer and send it to another customer. If a client is connected to the server, it does not happen unless another customer is connected. Then both customers start communicating with each other.

You will need to implement a protocol; check out . A part of this issue is determining which message you will send a message to. XMPP helps solve the problem I would recommend that each user joins the server, there will be a thread to handle the connection. You can then store all the threads in a hashmap where the key is the username. Then push the message to the thread implementation which send the message (SMS) to the customer.

Comments