954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

I've got another problem

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

parvin1987
Newbie Poster
7 posts since Mar 2006
Reputation Points: 10
Solved Threads: 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?

server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
 

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.

danglingChap
Newbie Poster
9 posts since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

well.. did u put while(true) ??

N[e]tt[e]
Newbie Poster
18 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

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

parvin1987
Newbie Poster
7 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You