class Net::SSH::Connection::SingleSessionEventLoop

optimized version for a single session

Public Instance Methods

ev_preprocess() { |first| ... } click to toggle source

Compatibility for original single session event loops: we call block with session as argument

# File lib/net/ssh/connection/event_loop.rb, line 99
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
ev_select_and_postprocess(wait) click to toggle source
# File lib/net/ssh/connection/event_loop.rb, line 106
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