使用升压 asio 发送带外数据

Send out-of-band data using boost asio

本文关键字:数据 asio      更新时间:2023-10-16

就像在 gnu c 中一样,有没有办法在 boost 中发送带外数据。 https://www.gnu.org/software/libc/manual/html_node/Out_002dof_002dBand-Data.html

您可以设置带外标志:https://www.boost.org/doc/libs/1_71_0/doc/html/boost_asio/reference/basic_stream_socket/out_of_band_inline.html

boost::asio::ip::tcp::socket socket(my_context);
// set out of band option
boost::asio::socket_base::out_of_band_inline option(true);
socket.set_option(option);
// get out of band option
socket.get_option(option);
bool value = option.value();