Re: socket call does not read full content




Allen McIntosh wrote:
jainarunk@xxxxxxxxx wrote:
I am implementing a http client and reading the content from the
socket. For MIME type

text/html the socket reads the full Content-Length bytes,

You were lucky. You will get however many bytes are available at the
time of the read. If the content is split over several frames, you may
not get everything in a single call.

Allen,

I am making several calls, till I count all bytes and total is equal to
Content-Length.
However after reading some 21 bytes less, the client does not have
anything to read
although expecting 21 more bytes and thus the client goes in an
infinite loop.

nagrik

.



Relevant Pages