Results 1 to 9 of 9
- 12-23-2008, 09:56 AM #1
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
- 12-23-2008, 10:46 AM #2
- 12-23-2008, 11:43 AM #3
yes I want to work with multiple threads in java . Can you suggest how to work with multiple threads please
- 12-23-2008, 12:15 PM #4
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.
- 12-23-2008, 12:16 PM #5
- 12-23-2008, 06:17 PM #6
Dear Erranga ,
Thanks for your timely guidance:)
- 12-24-2008, 03:47 AM #7
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.
- 12-24-2008, 05:05 AM #8
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!!!!!!!!!!:)
- 12-24-2008, 05:24 PM #9