class_docstr: Backend worker to handle Model Server's python service code
docstr: Handle socket connection.
  
  :param cl_socket:
  :return:
docstr_tok: ["Handle","socket","connection",".",":","param","cl_socket",":",":","return",":"]
code: def handle_connection(self, cl_socket):
      """
      Handle socket connection.
  
      :param cl_socket:
      :return:
      """
      service = None
      while True:
          if BENCHMARK:
              pr.disable()
              pr.dump_stats("/tmp/tsPythonProfile.prof")
          cmd, msg = retrieve_msg(cl_socket)
          if BENCHMARK:
              pr.enable()
          # b"I" encodes a model Inference request from frontend
          if cmd == b"I":
              if service is not None:
                  resp = service.predict(msg)
                  if LOCAL_RANK == 0:
                      cl_socket.sendall(resp)
                  else:
                      logging.info(
                          "skip sending response at rank %d", LOCAL_RANK
                      )
              else:
                  raise RuntimeError(
                      "Received command: {}, but service is not loaded".format(
                          cmd
                      )
                  )
          # b"I" encodes a model Loading request from frontend
          elif cmd == b"L":
              service, result, code = self.load_model(msg)
              resp = bytearray()
              resp += create_load_model_response(code, result)
              cl_socket.sendall(resp)
              if code != 200:
                  raise RuntimeError("{} - {}".format(code, result))
              service.set_cl_socket(cl_socket)
          else:
              raise ValueError(
                  "Received unknown command: {}".format(cmd)
              )
  
file_path: serve/ts/model_service_worker.py
imports: import logging
  import os
  import platform
  import socket
  import sys
  from typing import Optional
  from ts.arg_parser import ArgParser
  from ts.metrics.metric_cache_yaml_impl import MetricsCacheYamlImpl
  from ts.model_loader import ModelLoaderFactory
  from ts.protocol.otf_message_handler import create_load_model_response, retrieve_msg
label_desc: Use image node_id 3 for calling the TorchModelServiceWorker obj's underlying member method code with example usage: obj.handle_connection(cl_socket) without return types