2013/9/8 headius (Charles Nutter) <headius / headius.com>:

> I would agree, except that users are shown, through examples online and in source, that SSLSocket is "IO-like" and can be used anywhere an IO can be used. IO can do buffered IO and still be selectable. SSLSocket cannot.
>
> This is a shame because without the buffering in buffering.rb, it *would* be feasible to make select work with SSLSocket, as I have done in JRuby.

What's happen when the remote side of SSL protocol sends a partial record?
In that case, select notify readability (of encrypted data) but no decrypted
data readable.

What's also happen when the remote side request renegotiation and local side
write system call blocks?
It is difficult to say it is not happen.

I think checking bufer emptyness of SSL is not enough to avoid blocking at
blocking read invocation after select.
-- 
Tanaka Akira