module Net::SSH::Transport::PacketStream

def available_for_read?

Returns true if the IO is available for reading, and false otherwise.
def available_for_read?
  result = Net::SSH::Compat.io_select([self], nil, nil, 0)
  result && result.first.any?
end