
12 Jul
2012
12 Jul
'12
8:20 p.m.
Hello, In the code bellow I have forgotten to set the input vector (request) size. Is the code really supposed to react as an infinite loop (no errors, length is always 0, boost::asio::read returns immediately) or such behavior is a defect? for (;;) { std::vector<uint8_t> request; boost::system::error_code error; size_t length = boost::asio::read(sock, boost::asio::buffer(request), error); if (error == boost::asio::error::eof) break; else if (error) throw my_exception(L"Socket error"); ... } Thank you in advance, -- Michael Kochetkov