On Thursday, March 23, 2017 at 3:09:07 PM UTC-4, Christopher Pisz wrote:
> The following comparison fails for an error whom outputs "asio.misc" for errorCode.category().name() and "end of file" for errorCode.message()
>
> If it claims to be in category asio.misc, then why does the if condition of (errorCode.category() == boost::asio::error::misc_category ) evaluate to false?
>
Apart from the category issues, if you're getting "end of file" for
errorCode.message(), I don't think you'll get any more information by
examining the error code. The misc_errors enum value corresponding to that
message is misc_errors::eof.
What version of boost are you using? At one time (v 1.4) there actually was a
boost::system::misc_category, now (v 6.2) there's this for backwards
compatibility:
static const boost::system::error_category& misc_category
= boost::asio::error::get_misc_category();
I believe all the error codes are now covered by
boost::system::error_category.
If you're using a recent version of boost, I would not have expected you
would see an error category of "asio.misc". For recent versions, I would
expect (errorCode.category() == boost::asio::error::get_system_category())
Daniel