|
-
May 22nd, 2008, 10:55 AM
#1
When To Read from StreamReader
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|