A TCPListner problem that i am not sure about
-
:confused::confused:Ok, I have a server app that various ASP.NET web pages call upon. This server APP does stuff based on the request string being sent in from the ASP.NET web pages. Well here's the problem. If 4 clients connect at the same time on 4 different threads thread all the requests finish ok; cause i can see them finish. However, when it comes time to sned the client a completed request back only thread 1 gets a completed string back indicating that the request was comnpleted successfully and I am ready for the next; but threads 2, 3, 4 seem to just hang. The moment I shut the server off i.e stop listening threads 2 ,3 ,4 seem to finish and they get a completed message back. Any ideas on why this maybe happening or advice.
-
:confused::confused:Ok, I have a server app that various ASP.NET web pages call upon. This server APP does stuff based on the request string being sent in from the ASP.NET web pages. Well here's the problem. If 4 clients connect at the same time on 4 different threads thread all the requests finish ok; cause i can see them finish. However, when it comes time to sned the client a completed request back only thread 1 gets a completed string back indicating that the request was comnpleted successfully and I am ready for the next; but threads 2, 3, 4 seem to just hang. The moment I shut the server off i.e stop listening threads 2 ,3 ,4 seem to finish and they get a completed message back. Any ideas on why this maybe happening or advice.
Besides the obvious, that there is a bug in your code, I have experienced problems with the TcpClient class--losing data, basically. I've replaced the client-side with Indy Sockets[^] and my problem went away! BTW, the reason 2-4 are getting completed messages when you shut off the server is because the thread is actually exiting with a connection broken message. Off the cuff, I'd say you need to put in some more error checking to start with. Marc MyXaml Advanced Unit Testing YAPO