diff options
Diffstat (limited to 'lib/dtas/nonblock.rb')
-rw-r--r-- | lib/dtas/nonblock.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/dtas/nonblock.rb b/lib/dtas/nonblock.rb deleted file mode 100644 index 504c8d2..0000000 --- a/lib/dtas/nonblock.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2015-2016 all contributors <dtas-all@nongnu.org> -# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt> - -class DTAS::Nonblock < IO # :nodoc: - if RUBY_VERSION.to_f <= 2.0 - EX = {}.freeze - def read_nonblock(len, buf = nil, opts = EX) - super(len, buf) - rescue IO::WaitReadable - raise if opts[:exception] - :wait_readable - rescue EOFError - raise if opts[:exception] - nil - end - - def write_nonblock(buf, opts = EX) - super(buf) - rescue IO::WaitWritable - raise if opts[:exception] - :wait_writable - end - end -end |