开发者

unget bytes to boost::asio::ip::tcp::socket

开发者 https://www.devze.com 2023-01-22 03:57 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消