Repeat writeline

BlitzPlus Forums/BlitzPlus Programming/Repeat writeline

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Did you look into what is involved with implementing 1.1 protocol? This code shows repeated GET's using a single connection working just fine:
server$="www.blitzbasic.com"

www = OpenTCPStream(server,80)
If Not www 
	Notify" connection failed"
	End
EndIf

While True

	request$="GET <a href="http://www.blitzbasic.com" target="_blank">http://www.blitzbasic.com</a> HTTP/1.1" + Chr$(13)+Chr$(10) + "Host: " + server$ + Chr$(13)+Chr$(10) + "User-Agent: blitzbasic" + Chr$(13)+Chr$(10) + "Accept: */*" + Chr$(13)+Chr$(10)

	WriteLine www,request

	While True
		a$=ReadLine(www)
		If Instr(Lower(a$),"</html>") Exit
		Print a$
	Wend
	
	Print ""
	Print "received document "+n+" times
	n=n+1
	Print ""

Wend