开发者

what values can I pass to message_flags attribute in stream_socket_service::receive

开发者 https://www.devze.com 2023-03-15 06:33 出处:网络
I am trying to use socket::receive in boost asio to receive data over network. I want it to blo开发者_JS百科ck until certain size of data is available. For that it seems that I will have to set messag

I am trying to use socket::receive in boost asio to receive data over network. I want it to blo开发者_JS百科ck until certain size of data is available. For that it seems that I will have to set message_flag argument to the receive function, but I cannot find the information on what value can I pass so that the receive will be blocked until certain size of data is available. All I seen that its an integer.

Can someone tell me what are valid values that can be passed?


For that it seems that I will have to set message_flag argument to the receive function

This is incorrect. There are overloads to the async_read or read free function. They will read as many bytes as you request based on the buffer size:

Remarks

This overload is equivalent to calling:

boost::asio::read( s, buffers, boost::asio::transfer_all());

0

精彩评论

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

关注公众号