code: def write(self, message, opcode=None, encode=True, **kw):
          '''Write a new ``message`` into the wire.
  
          It uses the :meth:`~.FrameParser.encode` method of the
          websocket :attr:`parser`.
  
          :param message: message to send, must be a string or bytes
          :param opcode: optional ``opcode``, if not supplied it is set to 1
              if ``message`` is a string, otherwise ``2`` when the message
              are bytes.
           '''
          if encode:
              message = self.parser.encode(message, opcode=opcode, **kw)
          result = self.connection.write(message)
          if opcode == 0x8:
              self.connection.close()
          return resulf write(self, message, opcode=None, encode=True, **kw):
          '''Write a new ``message`` into the wire.
  
          It uses the :meth:`~.FrameParser.encode` method of the
          websocket :attr:`parser`.
  
          :param message: message to send, must be a string or bytes
          :param opcode: optional ``opcode``, if not supplied it is set to 1
              if ``message`` is a string, otherwise ``2`` when the message
              are bytes.
           '''
          if encode:
              message = self.parser.encode(message, opcode=opcode, **kw)
          result = self.connection.write(message)
          if opcode == 0x8:
              self.connection.close()
          return result
docs: Write a new ``message`` into the wire.
  
          It uses the :meth:`~.FrameParser.encode` method of the
          websocket :attr:`parser`.
  
          :param message: message to send, must be a string or bytes
          :param opcode: optional ``opcode``, if not supplied it is set to 1
              if ``message`` is a string, otherwise ``2`` when the message
              are bytes.