Boost logo

Boost Users :

Subject: Re: [Boost-users] asio error codes
From: Igor R (boost.lists_at_[hidden])
Date: 2011-10-04 12:04:16


> I don't see in the documentation anything that says which error code could
> result from the various asynchronous calls.
>
> Obviously, I would have to identify all connection related error codes and set
> the state of my process such that a reconnect was the way to handle it. In
> some cases a retry might be needed. However, I don't see a way to get a list
> of the possible error codes that need to get checked for aside from hours and
> hours of debugging trial and error.
>
> Does there exist somewhere a list of error codes that could result from
> async_read? which would I get from async_write?, async_accept? etc..etc.
>
> I see it is a sytem::error_code, and I can look at the header, I can even find
> a doc that lists all of them and see asio has a group, but I can't tell which might occur when.

Most of error_code values come from the lower levels and they are just
translated/propagated by asio to your application, so the error you
get is not even platform-independent, i.e. on some platform you can
get one error, while in the same situation on another platform you
might get another error.
But does it really affect states in your progam? Why is it important
for your state-machine whether you get 10053, 10054 or 10060 error
code?


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