From: Tanaka Akira Date: 2013-09-10T10:48:25+09:00 Subject: [ruby-core:57096] Re: [ruby-trunk - Bug #8875] Select is not usable with SSLSocket 2013/9/8 headius (Charles Nutter) : > 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