10-06-2005, 04:40 PM
Thumbs Must Hurt
Join Date: Apr 2005
Location: Portland, OR., USA
Post Thanks: 0
Thanked 0 Times in 0 Posts
If you want a readLine function, then you would need to read byte by byte so you could stop at a EOL and the function then returns all characters up to the EOL. Typically, a readLine() does not include the EOL characters themselves.
If you want to read a chunk of data, then you would have to read all the server data and split up the big chunk into its individual lines. If you stopped once you found an EOL in your chunk, then your reader routine would have to save the remaining chars (after the EOL) so it could append its next read. This would not be a good approach.
As for byte by byte reading being slow. I believe the byte read would be occuring on a buffer of data that was sent down from the server, and not doing a byte read request back to the server.