Boost logo

Boost :

From: Hugo Duncan (hugoduncan_at_[hidden])
Date: 2003-11-10 16:28:13

Michel André <michel.andre_at_[hidden]> wrote:

>> How is errors communicated to the on_read/on_write handlers
>> communicated,
>> via the policy?
> [snip]
>> I think I would shy away from providing error codes to the user level
>> read/write completion notification functions, unless a compelling case
>> to do so is found.

> The main reasons for me to suggest that was that in case of exceptions
> and asynchrounous sockets is that its the exception could be thrown
> asynchrounously in a thread that didn't make the request but in the one
> dequeuing the completion.

Your point being that using exceptions in this case is not possible?

> And that it is hard to associate the socket
> instance with the error in case several sockets is associated with a
> reactor/proactor instance.

So would a call to the UserConnection's on_error method with an error
code suffice? Do you have a concrete example of when you have needed
to explicitly handle error codes, other than those associated with
connection closure or flow handling (eg WOULD_BLOCK or IO_PENDING)?


Boost list run by bdawes at, gregod at, cpdaniel at, john at