Results 1 to 9 of 9

Thread: client_server

  1. #1
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    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:)

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Basic thing is about multi-threaded application. Do you know how to work around with multiple threads in Java?

  3. #3
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Default

    Dear Eranga!!!!!!!
    yes I want to work with multiple threads in java . Can you suggest how to work with multiple threads please

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  6. #6
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    Smile thanks

    Dear Erranga ,
    Thanks for your timely guidance:)

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    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.

  8. #8
    raghu9198's Avatar
    raghu9198 is offline Member
    Join Date
    Dec 2008
    Posts
    32
    Rep Power
    0

    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!!!!!!!!!!:)

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •