Glad you got it working.
Type: Posts; User: Norm
Glad you got it working.
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...
You need more details. For example where is the looping?
Have you worked out the logic in pseudo code yet? List the steps the code should do before writing the code.
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...
I explained in post#2. What part of that is a problem for you?
Your forever while loop is calling a method that is causing the exception.
Re-read post#2
Try it with the printStackTrace calls to see if there are errors.
Re-read post#2
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.
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...