
I would prefer a error message or crash because it is logically to suppose the asio would resize the vector or emit a error because it cannot handle situation properly (IMO). The concern behind the issue is working time and money -- it is really tricky for inexperienced boost users to figure out
On Fri, Jul 13, 2012 at 2:19 PM, Michael Kochetkov <michael.kv@gmail.com> wrote: the
culprit of the behavior. The program does not crash, it reports no errors and it just does not work.
It seems like the documentation already addresses both of these questions.
For boost::asio::read() it says "The call will block until one of the following conditions is true: 1) The supplied buffers are full. That is, the bytes transferred is equal to the sum of the buffer sizes..." Ok. Thank you. I have considered this explanation but infinite loop confused me so I have decided to get an "official" opinion. We will try to be alerted to the issue.
As for supposing that the buffer might resize the vector for you, ASIO has no idea (for example) how large you'd be willing to let it grow. This is OK too. Though I bet the total majority of asio customers have to solve resizing problem somehow. I will probably add the total data size to the serialization protocol and wrap boost::asio::read function.
-- Michael Kochetkov