Link to home
Start Free TrialLog in
Avatar of brightwood
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.
Avatar of Nguyen Huu Phuoc
Nguyen Huu Phuoc
Flag of Viet Nam image

About server, you can use a JMS server to implement it and use topic connection.
You make an JMS endpoint to client can connect to this enpoint.
Phuoc
ASKER CERTIFIED SOLUTION
Avatar of hoomanv
hoomanv
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of Kanti
Kanti

This has the example which might help

http://www.cise.ufl.edu/~amyles/tcpchat/