|
-
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.
-
May 23rd, 2008, 01:53 AM
#2
Re: When To Read from StreamReader
I'm affraid, that while you are unable to use some communication platform like WCF or .NET Remoting (which seems to be your case), there is not much what you can do. U think that only way is to do it low-level and manage socets on your own.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post. 
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
|