Results 1 to 8 of 8
  1. #1
    niba10 is offline Member
    Join Date
    Feb 2011
    Posts
    30
    Rep Power
    0

    Default question about example i found on internet

    Hey i want to build a multithreaded server and client and i go to google -.-
    to look for some example and i found a really good one this :
    Multi-threaded Client/Server Applications

    and i want to ask why it can only accept until 10 connection and not more than 10 ??

  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
    20

    Default

    I'm not sure that you've read the complete article or not?

    Didn't you find the following?

    // This chat server can accept up to 10 clients' connections

    static clientThread t[] = new clientThread[10];

  3. #3
    niba10 is offline Member
    Join Date
    Feb 2011
    Posts
    30
    Rep Power
    0

    Default

    yee thats my question why it can accept only 10 connection i mean if i will change the array to 100 or 200 (how many i wish) it will work to ?
    Last edited by niba10; 03-14-2011 at 05:06 PM.

  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
    20

  5. #5
    niba10 is offline Member
    Join Date
    Feb 2011
    Posts
    30
    Rep Power
    0

    Default

    i changed to 15 and it still can only connect up to 10 connections ..
    but why its happen and cannot connect more then 10 ??

  6. #6
    niba10 is offline Member
    Join Date
    Feb 2011
    Posts
    30
    Rep Power
    0

    Default

    some one know why its happen and can explain please ??

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Read the rest of the code ...
    Java Code:
    for(int i=0; i<=9; i++){
        if(t[i]==null) {
            (t[i] = new clientThread(clientSocket,t)).start();
            break;
       }
    }

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,415
    Rep Power
    20

Similar Threads

  1. Internet search
    By mikerada6 in forum Advanced Java
    Replies: 2
    Last Post: 11-23-2010, 02:23 AM
  2. Dial to internet
    By newbiejava in forum New To Java
    Replies: 0
    Last Post: 07-05-2010, 08:50 AM
  3. RMI through Internet.???
    By bach_meoden in forum Networking
    Replies: 8
    Last Post: 05-19-2010, 02:48 PM
  4. My Web App on Internet
    By orion_mcl in forum Advanced Java
    Replies: 1
    Last Post: 03-14-2010, 09:13 PM
  5. Internet Explorer
    By maria.mt in forum New To Java
    Replies: 2
    Last Post: 04-17-2009, 05:10 AM

Posting Permissions

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