def listener(self):
        """Helper for mt_interact() -- this executes in the other thread."""
        while 1:
            try:
                data = self.read_eager()
            except EOFError:
                print('*** Connection closed by remote host ***')
                return
            if data:
                self.stdout.write(data)
            else:
                self.stdout.flush()
Helper for mt_interact() -- this executes in the other thread.