admin_vr400_script/lib/base.rb

21 lines
289 B
Ruby

require "socket"
if !IO.instance_methods.include?(:ready?)
class IO
def ready?
!IO.select([self], nil, nil, 0).nil?
end
end
end
class IO
def readable?
!IO.select([self], nil, nil, 0).nil?
end
def writable?
!IO.select(nil, [self], nil, 0).nil?
end
end