code: def tcp_server(
      self,
      server_prog,
      *,
      family=socket.AF_INET,
      addr=None,
      timeout=support.LOOPBACK_TIMEOUT,
      backlog=1,
      max_clients=10,
  ):
      if addr is None:
          if hasattr(socket, "AF_UNIX") and family == socket.AF_UNIX:
              with tempfile.NamedTemporaryFile() as tmp:
                  addr = tmp.name
          else:
              addr = ("127.0.0.1", 0)
  
      sock = socket.create_server(addr, family=family, backlog=backlog)
      if timeout is None:
          raise RuntimeError("timeout is required")
      if timeout <= 0:
          raise RuntimeError("only blocking sockets are supported")
      sock.settimeout(timeout)
  
      return TestThreadedServer(
          self, sock, server_prog, timeout, max_clients
      )
  
imports: import asyncio
  import asyncio.events
  import contextlib
  import os
  import pprint
  import select
  import socket
  import tempfile
  import threading
  from test import support
label_desc: Use image node_id 6 for calling the FunctionalTestCaseMixin obj's underlying member method code with example usage: obj.tcp_server(server_prog) and returns: TestThreadedServer