def handler(self, conn, *args):
<EOL>self.shell.stdout.write(self.shell.prompt)<EOL>line = self.shell.stdin.readline()<EOL>if not len(line):<EOL><INDENT>line = '<STR_LIT>'<EOL>return False<EOL><DEDENT>else:<EOL><INDENT>line = line.rstrip('<STR_LIT:\r\n>')<EOL>line = self.shell.precmd(line)<EOL>stop = self.shell.onecmd(line)<EOL>stop = self.shell.postcmd(stop, line)<EOL>self.shell.stdout.flush()<EOL>self.shell.postloop()<EOL>if stop:<EOL><INDENT>self.shell = None<EOL>conn.close()<EOL><DEDENT>return not stop<EOL><DEDENT>
Asynchronous connection handler. Processes each line from the socket.