code: def _send_packet(self, data):
          
          if self._closed:
              return
  
          data = json.dumps(data)
  
          def send():
              try:
                  yield From(self.pipe_connection.write(data))
              except BrokenPipeError:
                  self.detach_and_close()
          ensure_future(send())
docs: Send packet to client.