--0015174c0e8cb236da0464cad42d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 --0015174c0e8cb236da0464cad42d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class="gmail_quote">On Tue, Mar 10, 2009 at 2:29 AM, Tanaka Akira <span dir="ltr"><akr / fsij.org></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="im"> </div> Errno::EWOULDBLOCK exception extended by IO::WandRead (or<br> IO::WantWrite) is compatible with current ruby and<br> distinguishable with rescue clause.<br> <br> ¨Âåçéî¼âò¾ ¨Âïßïòßóóì®òåáäßîïîâìïã먱°©¼âò¾ ¨ÂåóãõÉϺº×áîôÒåáä¼âò¾ ¨ÂÏ®óåìåãô¨ÛéïßïòßóóìÝ©¼âò ¨Âåôòù¼âò¾ ¨ÂåóãõÉϺº×áîô×òéôå¼âò ¨ÂÏ®óåìåãô¨îéìÛéïßïòßóóìÝ©¼âò¾ ¨Âåôòù¼âò¾ ¨Âîä¼âò¾ <br> IO::WantRead and IO::WantWrite also helps non-SSL<br> nonblocking IO because we don't need to list several<br> exceptions as Errno::EAGAIN, Errno::EWOULDBLOCK.<br> <br> It is not committed because Martin said the names are not<br> good.<br> </blockquote></div><br>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<br><br>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)<br> <br>After that I can put together a patch and test the cases you're describing.<br><br>-- <br>Tony Arcieri<br> --0015174c0e8cb236da0464cad42d--