Method: Bro::Connection#wait

Defined in:
lib/Bro/connection.rb

#waitObject



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/Bro/connection.rb', line 54

def wait
  unless @io_object
    fd = bro_conn_get_fd(@bc)
    return false if fd < 0
    @io_object = IO.new(fd)
    @io_object.sync = true # don't buffer
  end
  # block until there is data
  if @io_object.closed?
    puts "ERROR: connection lost!"
    exit -1
  else
    IO.select([@io_object])
  end
end