module EventMachine::IMAP::CommandSender::LineBuffer
Buffers out-going string sending by-line.
This is safe to do for IMAP
because the client always ends transmission on a CRLF (for awaiting continuation requests, and for ending commands)
Public Instance Methods
post_init()
click to toggle source
Calls superclass method
# File lib/em-imap/command_sender.rb, line 138 def post_init super @line_buffer = "" end
send_line_buffered(str)
click to toggle source
# File lib/em-imap/command_sender.rb, line 143 def send_line_buffered(str) @line_buffer += str while eol = @line_buffer.index(CRLF) to_send = @line_buffer.slice! 0, eol + CRLF.size send_data to_send end end