Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Boost::Asio Async write failed: (2 Items)
   
Boost::Asio Async write failed  
Hi, I am porting an application to QNX 6.6 that uses boost::asio library.

I have already built the boost 1.57.0 binaries.  To test the library working, I ran two http server example codes using 
synchronized and asynchronized writing respectively (as attached).

The Sync version runs fine; while the Async one failed at writing.  It returned error "Operation canceled".  

Can anyone point out where I should look for?  Thanks.
Attachment: Text t_sync.cpp 782 bytes Text t_async.cpp 1.74 KB
Re: Boost::Asio Async write failed  
Found the problem:
async_write_some needs to hold on to the socket for writing later in write_handler; otherwise, the destructor of the 
socket cancels all async operations.