Boost logo

Boost :

From: Frank Birbacher (bloodymir.crap_at_[hidden])
Date: 2008-05-06 19:48:55


Hi!

Billy Chasen schrieb:
> Or can I just wrap the method (eg: async_write) in a try/catch? (Since
> the initial call may be fine, but later on, an async call fails and
> I'm already out of the try/catch block)

You cannot wrap the async_write call to catch the error. Instead the
async_write takes a WriteHandler which is called on completion of the
write operation. This handler takes a parameter of type error_code which
is used to signal errors. See
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/reference/async_write.html
and
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/reference/WriteHandler.html

Regards,
Frank


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk