I am developing a client server program which communicates with many clients at a time. My app is working fine with one client but for multiple clients I am not sure where to start with I mean how would I do this can I create threads for every request from the client or can I store the values of clients directly into an array as I am a beginner to java I'm a bit confused
please help me in this regard
Basic thing is about multi-threaded application. Do you know how to work around with multiple threads in Java?
yes I want to work with multiple threads in java . Can you suggest how to work with multiple threads please
Actually you have different approach for this.
For the server:
Use a thread for listen the client connection. Once the connection is made you can start a new thread to keep track of connected client. In that case you can create separate thread for each connection. If you have any UI for the server, better to use another thread for that.
For the client:
Actually you need only one thread for process the message from and to the server. Additional thread for UI.
If you don't know how to working on with thread/mutiple threads, better to read some books and have a try on simple application. Say for printing some dummy values and so on.
NOTE: Please use a dark color for your text. The color you are using now is hard to read.
Read the following Chapter. You can find a lot about threads there.
Dear Erranga ,
Thanks for your timely guidance:)
It's pleasure to help you.
I think first of all you have to learn about multiple threads in Java, right? Do that part until you have confidence on it. Then think about your application. You can find lots of tutorials on the web as well. All most all server-client applications are multi threaded.
Yes I will do that .........
I have started learning about multiple threads
thanks once again and if there is any problem can I disturb you with your permission!!!!!!!!!!:)
Anytime, just ask your question more clearly in the correct place. :)