brightwood
asked on
Multi Thread Server Client
Basically I want to make something similar to a messenger, or rather to IRC.
Server wait for clients to connect, if a client connects, a thread its created for him. I plan to make a swing graphical interface for Client, with a text box for user to write his message and a send button to send it to server. Also i guess that Client needs a thread that keeps listening for messages from server and update a TextArea when a massage its received. If user inputs, message its sended to server, and server resend it to ALL clients connected.
Any hints how I can do this best ? Some code will nice also because im new to this.
Server wait for clients to connect, if a client connects, a thread its created for him. I plan to make a swing graphical interface for Client, with a text box for user to write his message and a send button to send it to server. Also i guess that Client needs a thread that keeps listening for messages from server and update a TextArea when a massage its received. If user inputs, message its sended to server, and server resend it to ALL clients connected.
Any hints how I can do this best ? Some code will nice also because im new to this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think the best place to start is here: http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html which is a step by step tutorial on how to write a client/server application in Java.
You make an JMS endpoint to client can connect to this enpoint.
Phuoc