Class: Rex::IO::RingBufferUdp

Inherits:
RingBuffer show all
Defined in:
lib/rex/io/ring_buffer.rb

Instance Attribute Summary

Attributes inherited from RingBuffer

#beg, #cur, #fd, #monitor, #monitor_thread_error, #mutex, #queue, #seq, #size

Instance Method Summary collapse

Methods inherited from RingBuffer

#base_sequence, #clear_data, #create_stream, #initialize, #inspect, #last_sequence, #put, #read_data, #select, #start_monitor, #stop_monitor, #store_data, #wait, #wait_for

Constructor Details

This class inherits a constructor from Rex::IO::RingBuffer

Instance Method Details

#monitor_threadObject

The built-in monitor thread (normally unused with Metasploit)



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# File 'lib/rex/io/ring_buffer.rb', line 293

def monitor_thread
  Thread.new do
    begin
    while self.fd
      begin
        buff = self.fd.recvfrom_nonblock(1.0)
      rescue  IO::WaitReadable
        # IO.select([self.fd])
        next
      end
      next if not buff
      store_data(buff)
    end
    rescue ::Exception => e
      self.monitor_thread_error = e
    end
  end
end