class_docstr:     Telnet server implementation.
  
      Example::
  
          async def interact(connection):
              connection.send("Welcome")
              session = PromptSession()
              result = await session.prompt_async(message="Say something: ")
              connection.send(f"You said: {result}
  ")
  
          async def main():
              server = TelnetServer(interact=interact, port=2323)
              await server.run()
      
code: def _create_socket(cls, host: str, port: int) -> socket.socket:
      # Create and bind socket
      s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      s.bind((host, port))
  
      s.listen(4)
      return s
  
imports: from __future__ import annotations
  import asyncio
  import contextvars
  import socket
  from asyncio import get_running_loop
  from typing import Any, Callable, Coroutine, TextIO, cast
  from prompt_toolkit.application.current import create_app_session, get_app
  from prompt_toolkit.application.run_in_terminal import run_in_terminal
  from prompt_toolkit.data_structures import Size
  from prompt_toolkit.formatted_text import AnyFormattedText, to_formatted_text
  from prompt_toolkit.input import PipeInput, create_pipe_input
  from prompt_toolkit.output.vt100 import Vt100_Output
  from prompt_toolkit.renderer import print_formatted_text
  from prompt_toolkit.styles import BaseStyle, DummyStyle
  from .log import logger
  from .protocol import DO, ECHO, IAC, LINEMODE, MODE, NAWS, SB, SE, SEND, SUPPRESS_GO_AHEAD, TTYPE, WILL, TelnetProtocolParser
label_desc: Use image node_id 2 for calling the TelnetServer obj's underlying member method code with example usage: obj._create_socket(cls, host, port) and returns: s