0

I how another question

I ran a program with one client and one server.
it works correctly .but when I have a multiClient program ,the serverThread can not read the sentence from client .why it can't do this?is that because of extending thread

I know that client class sends the sentence but the server can not read that .what should I do?

please help me

4
Contributors
4
Replies
5
Views
11 Years
Discussion Span
Last Post by parvin1987
0

First of all, try to make your sentences more clear so I can understand. Secondly, are you sure the client has established a connection?

0

I how another question

I ran a program with one client and one server.
it works correctly .but when I have a multiClient program ,the serverThread can not read the sentence from client .why it can't do this?is that because of extending thread

I know that client class sends the sentence but the server can not read that .what should I do?

please help me

Please do ask question in bit more detail. We can't get the design of program you are making with these sentences.

There are a bit things that you can check. First of all make sure that each client is establishing the connectionwith server.

A better approach is to open connection with each client in separate thread. i.e if there are 3 clients connected to server, server must be running 3 threads to listen from these clients.

0

thanks all
I opened a new thread for each client and put a while (true) .now my program works correctly
thanks a lot

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.