Boost logo

Boost Users :

Subject: Re: [Boost-users] using system:error_code
From: liamv7 (liamv7_at_[hidden])
Date: 2010-07-01 17:03:59


On 1 July 2010 22:32, Lloyd <lloyd_at_[hidden]> wrote:
> Hi,
>
> How can I interpret and use the error_code in my application?
>
> As an example my ASIO async_read "handler function" receives one argument as
> error, as shown below
>
> void MyClass::AsyncReadHandler(const boost::system::error_code&
> error,std::size_t bytes_transferred)
> {
> }
>
[...]
> So how can I get the respective "enum" associated with the error
>
> Thanks a lot,
>   Lloyd

Hi Lloyd,
I think you mean:

if (error == boost::asio::error::operation_aborted) {...}
see Boost\include\boost-1_43\boost\asio\error.hpp for the asio enums
(and how to add your own errors).


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net