troubleshooting Question

StreamReader won't timeout at readline, no end of stream character?

Avatar of Doug
DougFlag for United States of America asked on
Visual Basic.NET
4 Comments1 Solution4295 ViewsLast Modified:
I'm creating a console application that uses streamwrite to write to a command window and the stream reader that reads the result.  from what I've gathered in looking through the web, the problem is that my result doesn't have an "end of stream" character ( like a crlf ) or something like that to denote the end of the stream so my application just hangs.  

I've tried to use the ReadToEnd but that fails immediately ( again maybe due to no EOS character )
There's nothing special about the end of the stream to check for.
I've tried to put it in a try catch block with no success either.

Any suggestions or solutions would be wonderful.
Do Until SR(2).EndOfStream = True
     Dim currentLine = ""
          currentLine = SR(2).ReadLine
     Catch ex As Exception
     End Try

Open in new window

Application Development Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros