I am trying to use socket::receive in boost asio to receive data over network. I want it to block 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?
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: