Larry Brister
asked on
Output Streamreader
I have an HTTP POST using
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(st Url), HttpWebRequest)
After posting the WebRequest
I have this
Dim streamResponse As Stream = myHttpWebResponse.GetRespo nseStream( )
Dim streamRead As New StreamReader(streamRespons e)
How do I gkeep my connection open and just receive Debug.Writeline everything that comes through...never closing the connection?
I can receive the first "chunk" no problem using the following code...but it will exit after the first chunk
Edit:
https://www.experts-exchange.com/R_21101.html
Modulus_Twelve
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(st
After posting the WebRequest
I have this
Dim streamResponse As Stream = myHttpWebResponse.GetRespo
Dim streamRead As New StreamReader(streamRespons
How do I gkeep my connection open and just receive Debug.Writeline everything that comes through...never closing the connection?
I can receive the first "chunk" no problem using the following code...but it will exit after the first chunk
Dim streamResponse As Stream = myHttpWebResponse.GetResponseStream()
Dim streamRead As New StreamReader(streamResponse)
Dim readBuff(12560) As [Char]
Dim count As Integer = streamRead.Read(readBuff, 0, 12560)
Debug.WriteLine(count)
Debug.WriteLine(ControlChars.Cr + "The contents of the HTML page are : ")
If count = 0 Then
GoTo TheStart
Else
While count > 0
Dim outputData As New [String](readBuff, 0, count)
Debug.WriteLine(outputData)
count = streamRead.Read(readBuff, 0, 12560)
End While
End If
Edit:
https://www.experts-exchange.com/R_21101.html
Modulus_Twelve
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
CodeCruiser...
Added this...
While streamResponse.CanRead
And refreshed the buffer inside each cycle on the output
THANKS!!!!
Remind me to buy you a Sody-Pop!
Been on this for 10 days
Added this...
While streamResponse.CanRead
And refreshed the buffer inside each cycle on the output
THANKS!!!!
Remind me to buy you a Sody-Pop!
Been on this for 10 days
Glad it worked :-)
ASKER
Man...I tell you what.
I went bin circles for a while. Thanks...You know how it is when you're too close to something
Fresh eyes are needed.
I went bin circles for a while. Thanks...You know how it is when you're too close to something
Fresh eyes are needed.
ASKER
I have the KeepAlive set to true already.
How do I do the loop on the response stream?
Doesn't it require a buffer?