Can I call async_write twice in a row?
Is this legal? I think I understood in the documentation that it isn't, but I'm not sure if it means this: void func() { async_write(....); async_write(...); } So, should I do this ALWAYS? void func() { async_write(..., another_func); } void another_func(const boost::system::error_code & ec, std::size_t bytes) { async_write(...); } Thanks in advance.
Hi,
Is this legal? I think I understood in the documentation that it isn't, but I'm not sure if it means this:
void func() {
async_write(....); async_write(...); } There is no problem with this, but the data is not guaranteed to be sent ordered. So if order matters (which is usually the case) either use one buffer or use the callback.
Regards, michi7x7
participants (3)
-
Germán Diago
-
Igor R
-
michi7x7