mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a39e9e0745
commit
54a61d3e2a
1 changed files with 9 additions and 2 deletions
11
io.c
11
io.c
|
@ -1941,14 +1941,21 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
|
|||
* until io is readable for avoiding busy loop.
|
||||
* This can be done as follows.
|
||||
*
|
||||
* # emulates blocking read (readpartial).
|
||||
* begin
|
||||
* result = io.read_nonblock(maxlen)
|
||||
* rescue IO::WaitReadable, Errno::EINTR
|
||||
* rescue IO::WaitReadable
|
||||
* IO.select([io])
|
||||
* retry
|
||||
* end
|
||||
*
|
||||
* Note that this is identical to readpartial
|
||||
* Although IO#read_nonblock doesn't raise IO::WaitWritable.
|
||||
* OpenSSL::Buffering#read_nonblock can raise IO::WaitWritable.
|
||||
* If IO and SSL should be used polymorphically,
|
||||
* IO::WaitWritable should be rescued too.
|
||||
* See the document of OpenSSL::Buffering#read_nonblock for sample code.
|
||||
*
|
||||
* Note that this method is identical to readpartial
|
||||
* except the non-blocking flag is set.
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in a new issue