wainwrightwt
May 22nd, 2008, 10:55 AM
I have a client app that interacts with a TELNET-like server.
I'm using a streamwriter to send a request, and a streamreader to get the response.
This is working for the most part, but occasionally the streamreader seems to be "reading to soon". Meaning the full response has not been posted to the stream.
My reader code is as follows:
while (sr.Peek() >= 0)
{
strBuffer.Append(sr.ReadLine());
}
Every once in a while the loop will exit without getting the full response.
What should I do? Thanks.
I'm using a streamwriter to send a request, and a streamreader to get the response.
This is working for the most part, but occasionally the streamreader seems to be "reading to soon". Meaning the full response has not been posted to the stream.
My reader code is as follows:
while (sr.Peek() >= 0)
{
strBuffer.Append(sr.ReadLine());
}
Every once in a while the loop will exit without getting the full response.
What should I do? Thanks.