Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

  1. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Glad you got it working.
  2. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Your steps are wrong. There should only be one waiting for connection in the loop.

    define server socket
    begin loop
    wait for connection
    get socket with connection
    create thread and pass it...
  3. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    You need more details. For example where is the looping?
  4. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Have you worked out the logic in pseudo code yet? List the steps the code should do before writing the code.
  5. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Your code did not put the call to accept() in the loop. Your loop called checkForConnections()

    When accept() returned with a socket, your code does not create a new thread to handle the connection...
  6. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    I explained in post#2. What part of that is a problem for you?
  7. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Your forever while loop is calling a method that is causing the exception.

    Re-read post#2
  8. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    Try it with the printStackTrace calls to see if there are errors.

    Re-read post#2
  9. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    You should add a call to printStackTrace() to all of the catch blocks to show any errors that occur.
    You should not ignore errors.

    BTW Please use CODE tags not QUOTE tags around your code.
  10. Replies
    21
    Views
    2,823

    Re: Multithreading / Multiple Connections

    The server should have a loop that contains the call to the accept() method. When the accept method returns with a socket connection to a client, it should create a new thread and pass that socket to...
Results 1 to 10 of 10