i have a client and a server program and i am trying to make multiple clients connect to one server. i create a new server thread each time a client connects. when i run the program, i can open up a single client and send a message to the server. but when i open up a new client and connect, the new client can send a message to the server but the first client doesnt send it anymore. could someone please tell me what im doing wrong.
ps. i took most of the code out to make it smaller. i think the problem is somewhere in this code but i cant find it.
This looks to be largely on the right track. One thing to try is avoid ready(). This only tells you whether there are bytes ready to read right now. It doesn't block and wait for some that might come later. Loop until the line you read is null.
Here's some very similar code that uses a thread pool instead of making new ones all the time:
[ May 21, 2006: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi