class_docstr: Internal proxy server handler class.
class_docstr_tok: ["Internal","proxy","server","handler","class","."]
docstr: Normal proxy mode when handler is ready.
docstr_tok: ["Normal","proxy","mode","when","handler","is","ready","."]
code: def _handler_ready_proxy_mode(self, handler):
      """Normal proxy mode when handler is ready."""
      if handler.rpc_key.startswith("server:"):
          pool_src, pool_dst = self._client_pool, self._server_pool
          timeout = self.timeout_server
      else:
          pool_src, pool_dst = self._server_pool, self._client_pool
          timeout = self.timeout_client
  
      key = handler.match_key
      if key in pool_src:
          self._pair_up(pool_src.pop(key), handler)
          return
      if key not in pool_dst:
          pool_dst[key] = handler
  
          def cleanup():
              """Cleanup client connection if timeout"""
              if pool_dst.get(key, None) == handler:
                  logging.info(
                      "Timeout client connection %s, cannot find match key=%s",
                      handler.name(),
                      key,
                  )
                  pool_dst.pop(key)
                  handler.send_data(
                      struct.pack("<i", base.RPC_CODE_MISMATCH)
                  )
                  handler.signal_close()
  
          self.loop.call_later(timeout, cleanup)
      else:
          logging.info("Duplicate connection with same key=%s", key)
          handler.send_data(struct.pack("<i", base.RPC_CODE_DUPLICATE))
          handler.signal_close()
  
imports: import os
  import asyncio
  import logging
  import socket
  import threading
  import errno
  import struct
  import time
  from tvm.contrib.popen_pool import PopenWorker
  from .None import _ffi_api
  from .None import base
  from .base import TrackerCode
  from .server import _server_env
  from .._ffi.base import py_str
label_desc: Use image node_id 7 for calling the ProxyServerHandler obj's underlying member method code with example usage: obj._handler_ready_proxy_mode(handler) without return types