Boost Asio how to read/write on a SSL socket that doesnt use SSL?

随声附和 提交于 2019-12-03 15:24:32

Actually I think I solved it now.

1) The "handshaking" on a non-ssl is indeed not necessary, I immediately do async_reading after the accept

2) Instead of async_read/write( socket_.lowest_layer(), ... ) I had to use socket_.next_layer().async_read_some( buffer, handler) and
async_write( socket_.next_layer(), ... )

I still dont know why it doesnt work with socket_.lowest_layer() (if someone knows, please explain) but at least it works just fine with the above methods. And I hope this will help other people with a similar problem too ;-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!