943,949 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 1323
  • Java RSS
Jul 10th, 2006
0

I've got another problem

Expand Post »
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
Last edited by parvin1987; Jul 10th, 2006 at 2:28 am.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
parvin1987 is offline Offline
7 posts
since Mar 2006
Jul 12th, 2006
0

Re: I've got another problem

First of all, try to make your sentences more clear so I can understand. Secondly, are you sure the client has established a connection?
Reputation Points: 113
Solved Threads: 19
Postaholic
server_crash is offline Offline
2,108 posts
since Jun 2004
Jul 13th, 2006
0

Re: I've got another problem

Quote originally posted by parvin1987 ...
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danglingChap is offline Offline
9 posts
since Sep 2004
Jul 15th, 2006
0

Re: I've got another problem

well.. did u put while(true) ??
Reputation Points: 10
Solved Threads: 0
Newbie Poster
N[e]tt[e] is offline Offline
18 posts
since Feb 2005
Jul 15th, 2006
0

Re: I've got another problem

thanks all
I opened a new thread for each client and put a while (true) .now my program works correctly
thanks a lot
Reputation Points: 10
Solved Threads: 0
Newbie Poster
parvin1987 is offline Offline
7 posts
since Mar 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: i need help in this
Next Thread in Java Forum Timeline: Can anyone suggest why this program doesn't calculate correctly?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC