'Send a frame over the websocket with message as its payload'

def send(self, message, binary=None):

    if (binary is None):
        binary = (not isinstance(message, string_types))
    opcode = (self.OPCODE_BINARY if binary else self.OPCODE_TEXT)
    try:
        self.send_frame(message, opcode)
    except WebSocketError:
        self.current_app.on_close(MSG_SOCKET_DEAD)
        raise WebSocketError(MSG_SOCKET_DEAD)
