Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] socket::read_some() splits data into two parts.
From: Slav (slavmfm_at_[hidden])
Date: 2011-05-11 11:11:35


"The read_some operation may not read all of the requested number of bytes."
is pretty clear because incoming message isn't bound to the BUFFER_SIZE
which is just the place where to srore intermediate data.

"Consider using the read function if you need to ensure that the requested
amount of data is read before the blocking operation completes."
sounds like "read until my buffer will be fulled regardless of incoming
message length" - not like "read until the logical message will be fully
read and use my buffer as something where data will be put - regargingly
it's size".

And, by the way, there could come empty messages - just without any data.

TCP contains info about message length - it is duplication to prefix all
messages with it's length.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net