parameters: (socket, address, io_loop)
docstring: A server connection handler that repeats back lines received
      from the client.  The server stops echoing if the client says
      'goodbye'.
docstring_summary: A server connection handler that repeats back lines received
      from the client.  The server stops echoing if the client says
      'goodbye'.
docstring_tokens: A server connection handler that repeats back lines received from the client . The server stops echoing if the client says goodbye .
function: def echo(socket, address, io_loop):
      """A server connection handler that repeats back lines received
      from the client.  The server stops echoing if the client says
      'goodbye'."""
  
      stream = IOStream(socket, io_loop=io_loop)
  
      def write(data, *args):
          print 'S: %r' % data
          stream.write(data, *args)
  
      def handle(data):
          if data == 'goodbye\n':
              write('See you later.\n', stream.close)
          else:
              write('You said: "%s".\n' % data.strip())
              loop()
  
      def loop():
          stream.read_until("\n", handle)
  
      loop()
function_tokens: def echo ( socket , address , io_loop ) : stream = IOStream ( socket , io_loop = io_loop ) def write ( data , * args ) : print 'S: %r' % data stream . write ( data , * args ) def handle ( data ) : if data == 'goodbye\n' : write ( 'See you later.\n' , stream . close ) else : write ( 'You said: "%s".\n' % data . strip ( ) ) loop ( ) def loop ( ) : stream . read_until ( "\n" , handle ) loop ( )