In article <c7e6b2b00903101457x7fe9aa7bj512459e541dd6952 / mail.gmail.com>, Tony Arcieri <tony / medioh.com> writes: > 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 OpenSSL::SSL::SSLError may be better than Errno::EWOULDBLOCK. It force people to rescue IO::WantRead instead of 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) I've just thought IO::WaitReadable and IO::WaitWritable. The modules are used not only for read/write but also for connect/accept. nonblocking connect needs to wait writability. begin sock.connect_nonblock(arg) rescue IO::WriteAgain IO.select(nil, [sock]) # wait 3-way handshake begin sock.connect_nonblock(arg) # error check rescue Errno::EISCONN end end I think WriteAgain is not suitable for connect_nonblock because the application doesn't seem to write. Another concern is the third argument of IO.select. It waits exceptional condition. One usage is out-of-band data in TCP. IO::WaitException or IO::WaitError may be required in future. I guess IO::ExceptionAgain is not a good name because exception is not a verb. -- Tanaka Akira