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
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Dear Erranga
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!!!!!!!!!!