(self, payload, opcode = ABNF.OPCODE_TEXT)
Send the data as string.

        payload: Payload must be utf-8 string or unicoce,
                  if the opcode is OPCODE_TEXT.
                  Otherwise, it must be string(byte array)

        opcode: operation code to send. Please see OPCODE_XXX.
Send the data as string.
Send the data as string .
def send(self, payload, opcode = ABNF.OPCODE_TEXT):
        """
        Send the data as string.

        payload: Payload must be utf-8 string or unicoce,
                  if the opcode is OPCODE_TEXT.
                  Otherwise, it must be string(byte array)

        opcode: operation code to send. Please see OPCODE_XXX.
        """
        frame = ABNF.create_frame(payload, opcode)
        if self.get_mask_key:
            frame.get_mask_key = self.get_mask_key
        data = frame.format()
        self.io_sock.send(data)
        if traceEnabled:
            logger.debug("send: " + repr(data))
def send ( self , payload , opcode = ABNF . OPCODE_TEXT ) : frame = ABNF . create_frame ( payload , opcode ) if self . get_mask_key : frame . get_mask_key = self . get_mask_key data = frame . format ( ) self . io_sock . send ( data ) if traceEnabled : logger . debug ( "send: " + repr ( data ) )