hi
can any one give me a code for chatserver in java which have bi-directional comminication.lik server listen more no.of clients n give reply and client mak request to server. ther should be a frame where a textarea and a textfield.all messages are printed on textarea and after hit of return key from keybord the textfield area will blank.

Recommended Answers

All 6 Replies

I've pretty much decided my next project after I submit my SCJD work will be to create a complete IRC server in Java.
I might even release the source after it's done, but it will likely take a few years until it's fully functional unless I bring others on board to assist in the project.

There is a briliant tutorial in Deitel&Deitel book Programming in Java Sixth Edition somewhere around cahpter 23-24

The biggest problem is multithreading. If you want to use it with a GUI then you'll most certainly have to use multithreading. I made a really crappy one a while back just as a console application, because the multithreading got to be a pain.

the tutorial which i mentioned has multithreading. It is starting from simple window to window messaging and than they explain advance technics which include multithreading

for the server you ALWAYS have to use multithreading ;)
For the client as well really, else you either can never enter any text yourself or won't get anything back until you do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.