class_docstr: Telnet server implementation.
docstr: Run the eventloop for the telnet server.
docstr_tok: ["Run","the","eventloop","for","the","telnet","server","."]
code: def run(self):
      """
      Run the eventloop for the telnet server.
      """
      listen_socket = self.create_socket(self.host, self.port)
      logger.info(
          "Listening for telnet connections on %s port %r",
          self.host,
          self.port,
      )
  
      try:
          while True:
              # Removed closed connections.
              self.connections = set(
                  [c for c in self.connections if not c.closed]
              )
  
              # Ignore connections handling commands.
              connections = set(
                  [
                      c
                      for c in self.connections
                      if not c.handling_command
                  ]
              )
  
              # Wait for next event.
              read_list = [listen_socket, self._schedule_pipe[0]] + [
                  c.conn for c in connections
              ]
  
              read, _, _ = select.select(read_list, [], [])
  
              for s in read:
                  # When the socket itself is ready, accept a new connection.
                  if s == listen_socket:
                      self._accept(listen_socket)
  
                  # If we receive something on our "call_from_executor" pipe, process
                  # these callbacks in a thread safe way.
                  elif s == self._schedule_pipe[0]:
                      self._process_callbacks()
  
                  # Handle incoming data on socket.
                  else:
                      self._handle_incoming_data(s)
      finally:
          listen_socket.close()
  
imports: from __future__ import unicode_literals
  import socket
  import select
  import threading
  import os
  import fcntl
  from six import int2byte, text_type, binary_type
  from codecs import getincrementaldecoder
  from prompt_toolkit.enums import DEFAULT_BUFFER
  from prompt_toolkit.eventloop.base import EventLoop
  from prompt_toolkit.interface import CommandLineInterface, Application
  from prompt_toolkit.layout.screen import Size
  from prompt_toolkit.shortcuts import create_prompt_application
  from prompt_toolkit.terminal.vt100_input import InputStream
  from prompt_toolkit.terminal.vt100_output import Vt100_Output
  from .log import logger
  from .protocol import IAC, DO, LINEMODE, SB, MODE, SE, WILL, ECHO, NAWS, SUPPRESS_GO_AHEAD
  from .protocol import TelnetProtocolParser
  from .application import TelnetApplication
label_desc: Use image node_id 6 for calling the TelnetServer obj's underlying member method code with example usage: obj.run() without return types