code: def _run(self, conn):
      s1, s2 = self._create_socks()
  
      state = NNGDevice.STATE_INIT
  
      while True:
          cmd = conn.recv()
          if state == NNGDevice.STATE_INIT:
              # wait for bind
              if cmd != "#bind":
                  conn.send("bad command, expecting #bind")
              else:
                  logger.debug("%s got #bind", self.__class__.__name__)
                  # bind sockets
                  port1, port2 = self._bind_socks(s1, s2)
  
                  conn.send((port1, port2))
  
                  state = NNGDevice.STATE_AFTER_INIT
          elif state == NNGDevice.STATE_AFTER_INIT:
              # wait for start()
              if cmd != "#start":
                  conn.send("bad command, expecting #start")
              else:
                  logger.debug("%s got #start", self.__class__.__name__)
                  # ACK
                  conn.send(None)
                  # Keeps running forever
                  self._run_device(s1, s2)
                  state = NNGDevice.STATE_FINISHED
                  logger.debug("%s finished", self.__class__.__name__)
                  conn.send("bad command, expecting #start")
                  break
          else:
              break
  
imports: import random
  import logging
  import multiprocessing
  import threading
  from fiber.backend import get_backend
label_desc: Use image node_id 7 for calling the NNGDevice obj's underlying member method code with example usage: obj._run(conn) without return types