! eof() is super slow - see test results

Blitz3D Forums/Blitz3D Programming/! eof() is super slow - see test results

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.

H!

I was testing something with getting the a ip from my website and have this test results

with eof() 23 seconds
with-out eof() 1 or less seconds !!!

the only thing is that you must know how many line's you need to read. (but I can use php for that)

code with eof()
www=OpenTCPStream("213.211.129.194",80)
If Not www RuntimeError "Failed to connect"
WriteLine www,"GET /get_ip.php HTTP/1.1"
WriteLine www,"Host: www.zquare.nl"
WriteLine www,"User-Agent: ZquareTest"
WriteLine www,"Accept: */*"
WriteLine www,""
While Not Eof(www)
Print ReadLine(www)
Wend
CloseTCPStream www


code with-out eof()
www=OpenTCPStream("213.211.129.194",80)
If Not www RuntimeError "Failed to connect"
WriteLine www,"GET /get_ip.php HTTP/1.1"
WriteLine www,"Host: www.zquare.nl"
WriteLine www,"User-Agent: ZquareTest"
WriteLine www,"Accept: */*"
WriteLine www,""
;or for loop etc.
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)
Print ReadLine(www)

CloseTCPStream www