This class provides a backwards compatible "stream" socket that uses the parents ring buffer.
# File lib/rex/io/ring_buffer.rb, line 248 def read(len=nil) if len and self.buff.length >= len data = self.buff.slice!(0,len) return data end while true lseq, data = self.ring.read_data( self.seq ) return if not lseq self.seq = lseq self.buff << data if len if self.buff.length >= len return self.buff.slice!(0,len) else IO.select(nil, nil, nil, 0.25) next end end data = self.buff self.buff = '' return data # Not reached break end end
Generated with the Darkfish Rdoc Generator 2.