Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-23-2008, 09:56 AM
raghu9198's Avatar
Member
 
Join Date: Dec 2008
Posts: 32
Rep Power: 0
raghu9198 is on a distinguished road
Default client_server
hi all,

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


Thanks,
raghu
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 12-23-2008, 10:46 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Basic thing is about multi-threaded application. Do you know how to work around with multiple threads in Java?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-23-2008, 11:43 AM
raghu9198's Avatar
Member
 
Join Date: Dec 2008
Posts: 32
Rep Power: 0
raghu9198 is on a distinguished road
Default
Dear Eranga!!!!!!!
yes I want to work with multiple threads in java . Can you suggest how to work with multiple threads please
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-23-2008, 12:15 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-23-2008, 12:16 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Read the following Chapter. You can find a lot about threads there.

Multiple Threads.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 12-23-2008, 06:17 PM
raghu9198's Avatar
Member
 
Join Date: Dec 2008
Posts: 32
Rep Power: 0
raghu9198 is on a distinguished road
Smile thanks
Dear Erranga ,
Thanks for your timely guidance
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 12-24-2008, 03:47 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 12-24-2008, 05:05 AM
raghu9198's Avatar
Member
 
Join Date: Dec 2008
Posts: 32
Rep Power: 0
raghu9198 is on a distinguished road
Smile thanks

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!!!!!!!!!!
Bookmark Post in Technorati
Reply With Quote
  #9 (permalink)  
Old 12-24-2008, 05:24 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Anytime, just ask your question more clearly in the correct place.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +2. The time now is 01:27 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org