8 messages · Page 1 of 1 (latest)
you should be reading in a loop
probably the header comes first and the content later
but you stop reading after the first time
read says it will read at least 1 byte
where 1 is completely acceptable
so you're not guaranteed to even get the header right now
the for loop is fine
the reading part is the problem