TcpClient Http Request read all lines?

Spilled

Member
Joined
Nov 28, 2008
Messages
17
Location
USA
Programming Experience
Beginner
Hello All, I just have a question. My program uses the tcpclient class to connect to a proxy and then request a Web page. Sometimes the proxy is slow and it doesnt retrieve the whole web page. When the Content-Length field of the http header is not present, How can i stay in the recieve loop until i know that i recieve the whole web page. What else can i use? Thanks in advance.
 
From StreamReader.ReadLine help:
The next line from the input stream, or a null reference (Nothing in Visual Basic) if the end of the input stream is reached.
VB.NET:
Do
    Dim line As String = reader.ReadLine
    If line Is Nothing Then Exit Do
    builder.AppendLine(line)
Loop
 
Back
Top