class Net::SSH::Connection::SingleSessionEventLoop
optimized version for a single session
def ev_preprocess(&block)
Compatibility for original single session event loops:
def ev_preprocess(&block) return false if block_given? && !yield(@sessions.first) @sessions.each(&:ev_preprocess) return false if block_given? && !yield(@sessions.first) return true end
def ev_select_and_postprocess(wait)
def ev_select_and_postprocess(wait) raise "Only one session expected" unless @sessions.count == 1 session = @sessions.first sr, sw, actwait = session.ev_do_calculate_rw_wait(wait) readers, writers, = IO.select(sr, sw, nil, actwait) session.ev_do_handle_events(readers, writers) session.ev_do_postprocess(!((readers.nil? || readers.empty?) && (writers.nil? || writers.empty?))) end