On Tue, Mar 10, 2009 at 2:29 AM, Tanaka Akira <akr / fsij.org> wrote:

>  Errno::EWOULDBLOCK exception extended by IO::WandRead (or
> IO::WantWrite) is compatible with current ruby and
> distinguishable with rescue clause.
>
>  begin
>    io_or_ssl.read_nonblock(10)
>  rescue IO::WantRead
>    IO.select([io_or_ssl])
>    retry
>  rescue IO::WantWrite
>    IO.select(nil, [io_or_ssl])
>    retry
>  end
>
> IO::WantRead and IO::WantWrite also helps non-SSL
> nonblocking IO because we don't need to list several
> exceptions as Errno::EAGAIN, Errno::EWOULDBLOCK.
>
> It is not committed because Martin said the names are not
> good.
>

All right, as soon as you've finalized the exception names I will use those
in openssl-nonblock in lieu of my current ones and make them both descend
from Errno::EWOULDBLOCK

My exceptions were called ReadAgain and WriteAgain.  Perhaps those would be
better names? (although perhaps a bit confusing if descending from
Errno::EWOULDBLOCK as opposed to Errno::EAGAIN)

After that I can put together a patch and test the cases you're describing.

-- 
Tony Arcieri