This class implements input against a socket.
# File lib/rex/ui/text/input/buffer.rb, line 28 def close @sock.cleanup_abstraction end
Returns whether or not EOF has been reached on stdin.
# File lib/rex/ui/text/input/buffer.rb, line 64 def eof? @sock.lsock.closed? end
Returns the file descriptor associated with a socket.
# File lib/rex/ui/text/input/buffer.rb, line 71 def fd return @sock.rsock end
Wait for a line of input to be read from a socket.
# File lib/rex/ui/text/input/buffer.rb, line 43 def gets # Initialize the line buffer line = '' # Read data one byte at a time until we see a LF while (true) break if line.include?("\n") # Read another character of input char = @sock.rsock.getc # Append this character to the string line << char end return line end
Generated with the Darkfish Rdoc Generator 2.