Reputation: 3223
I call boost::asio::serial_port::async_write_some() and asio::io_service::run() in the other thread. There is a callback given to "async_write_some". Can I safely assume, that this callback will be eventually called (possibly with some error code)? Under what circumstances it's not true?
Upvotes: 2
Views: 304
Reputation: 15075
As long as io_service runs, a completion handler is guaranteed to get invoked after the async operation is completed (either successfully or not).
Upvotes: 3
Reputation: 8660
Can I safely assume, that this callback will be eventually called (possibly with some error code)?
I think no.
Under what circumstances it's not true?
The io_service::stop method is called before data is sent.
Upvotes: 4