Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-06-26 09:37:19


Oliver.Kowalke_at_[hidden] wrote:
> the system_message function is implemented with ::strerror.
> How to handle systems erros related like EAI_NONAME (host not
> found), EAI_MEMORY (allocation failure) etc.? This erros
> occure in the context of getaddrinfo (related to network
> address and service translation) and requier ::gai_strerror in
> system_message.

And there's also the error EAI_SYSTEM, which means that the
actual error value is to be found in errno instead.

This is the issue I raised a while back, where I suggested that
maybe we need support for implementation-defined error
categories, or "errorspaces". I'm not sure what the best
solution is, but it's a problem that needs to be solved for
asio.

I'm definitely in favour of having a single error_code type used
across all system functions to allow the simpler composition of
higher-level system operations. For example:

- A connect_host/async_connect_host function as suggested by
  Cory would need to use a resolver (which raises
  getaddrinfo-sourced errors) followed by a socket (which raises
  errno errors).

- A hypothetical transmit_file/async_transmit_file function
  could have errors resulting from filesystem access or from
  socket operations.

There's also the problem of the error asio::error::eof, which
corresponds to a real error on Windows, but is synthesised on
POSIX platforms.

Cheers,
Chris


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