code: def _dispatch_request(self, json_request):
      try:
          if json_request[FIELD_MSGTYPE] == MSG_CONTROL:
              if json_request[FIELD_OPTYPE] == CONTROL_SHUTDOWN:
                  self._active = False
                  self._reply(MSG_REPLY, self.encode(None))
                  return
              elif json_request[FIELD_OPTYPE] == CONTROL_GETEXPORTS:
                  self._reply(
                      MSG_REPLY,
                      {
                          "classes": list(self._known_classes),
                          "functions": list(self._known_funcs),
                          "values": list(self._known_vals),
                          "exceptions": self._known_exceptions,
                          "proxied": list(self._proxied_types),
                          "aliases": self._aliases,
                      },
                  )
                  return
              else:
                  raise ValueError("Unknown control message")
          if json_request[FIELD_MSGTYPE] != MSG_OP:
              raise ValueError(
                  "Invalid message received: %s" % json_request
              )
          op_type = json_request[FIELD_OPTYPE]
          op_target = json_request.get(FIELD_TARGET)
          if op_target is not None:
              op_target = self.decode(op_target)
          args = json_request.get(FIELD_ARGS)
          if args is not None:
              args = self.decode(args)
          kwargs = json_request.get(FIELD_KWARGS)
          if kwargs is not None:
              kwargs = dict(self.decode(kwargs))
  
          result = self._handlers[op_type](op_target, *args, **kwargs)
      except:  # noqa E722
          ex_type, ex, trace_back = sys.exc_info()
          if ex_type is SystemExit or ex_type is KeyboardInterrupt:
              raise
          try:
              self._reply(
                  MSG_EXCEPTION,
                  self.encode_exception(ex_type, ex, trace_back),
              )
          except (SystemExit, KeyboardInterrupt):
              raise
          except:  # noqa E722
              internal_err = traceback.format_exc()
              self._reply(MSG_INTERNAL_ERROR, internal_err)
      else:
          try:
              self._reply(MSG_REPLY, self.encode(result))
          except (SystemExit, KeyboardInterrupt):
              raise
          except:  # noqa E722
              internal_err = traceback.format_exc()
              self._reply(MSG_INTERNAL_ERROR, internal_err)
  
imports: import importlib
  import itertools
  import pickle
  import socket
  import sys
  import traceback
  from .None import data_transferer
  from .consts import FIELD_ARGS, FIELD_CONTENT, FIELD_KWARGS, FIELD_MSGTYPE, FIELD_OPTYPE, FIELD_TARGET, MSG_CONTROL, MSG_EXCEPTION, MSG_INTERNAL_ERROR, MSG_OP, MSG_REPLY, OP_GETATTR, OP_SETATTR, OP_DELATTR, OP_CALL, OP_CALLATTR, OP_REPR, OP_STR, OP_HASH, OP_PICKLE, OP_DEL, OP_GETMETHODS, OP_DIR, OP_CALLFUNC, OP_CALLONCLASS, OP_GETVAL, OP_SETVAL, OP_INIT, VALUE_LOCAL, VALUE_REMOTE, CONTROL_GETEXPORTS, CONTROL_SHUTDOWN
  from .communication.channel import Channel
  from .communication.socket_bytestream import SocketByteStream
  from .communication.utils import __try_op__
  from .data_transferer import DataTransferer, ObjReference
  from .override_decorators import RemoteAttrOverride, RemoteOverride, RemoteExceptionSerializer
  from .exception_transferer import dump_exception
  from .utils import get_methods, get_canonical_name
label_desc: Use image node_id 6 for calling the Server obj's underlying member method code with example usage: obj._dispatch_request(json_request) without return types