I need the two bytes to be read f开发者_如何转开发rom the socket, and, if necessary, bring them back into the socket, so the next handler read them. how it can be implemented? Thanks.
you could use read_some and have a buffer the size of 2 in the beginning then resize the buffer on the second read.
Hope this helps
also
http://www.boost.org/doc/libs/1_35_0/boost/asio/ssl/stream.hpp
peek function might be of more use to you.
精彩评论