I've got some kind of debug-prints in boost using application. When something comes to 80th port I see "Somebody's knoking", and few other string showing the process of query analysis. So, on string
std::string std_st = std::string(std::istreambuf_iterator<char>(&_inbuffer),
std::istreambuf_iterator<char>());
it restarts listening to port and reading to buffer 4-5 times! (I have 4 Somebody's knoking and other strings on console).
Here's my readblock:
boost::asio::read_until((*_sock), _inbuffer, "\r\n\r\n" );
std::string std_st = std::string(std::istreambuf_iterator<char>(&_inbuffer),
std::istreambuf_iterator<char>());
str = std_st.c_str();
debugout(" ::ANSWER \r\n");
boost::asio::write((*_sock), _inbuffer, boost::asio::transfer_all());
What happens?
PS Listening and so on is really simple, nearly like in samples.