In article <49a642ba6184_852787888e668d / redmine.ruby-lang.org>,
  Tony Arcieri <redmine / ruby-lang.org> writes:

> This addresses the full requirements of non-blocking SSL and has been used in real-world applications within a nonblocking event framework.

Does it care the I/O buffer implemented in
ext/openssl/lib/openssl/buffering.rb ?

What's happen if nonblocking methods and blocking methods
are used both?

Note that IO#read_nonblock reads from IO buffer if it is not
empty.  IO#write_nonblock flushes IO buffer.

See read_nonblock implementation in
ext/openssl/lib/openssl/buffering.rb in ruby-1.9.2dev.

> - Separate exceptions are provided for when a given operation requires the socket to be in the readable or writable state, regardless of what operation was requested.  A read request may require the socket to be writable to continue, or vice versa, due to the requirements of SSL (e.g. session renegotiation)

Different classes makes OpenSSL nonblocking methods and
IO/Socket nonblocking methods incompatible.

I think Errno::EWOULDBLOCK object extended by some module,
IO::WandRead or IO::WantWrite, is better.
-- 
Tanaka Akira