'Wrapper for sending data to add in the WebSocket frame format.'

def send_frame(self, data):

    frame_bytes = list()
    frame_bytes.append(130)
    frame_bytes.append((len(data) | 128))
    mask = [7, 2, 1, 9]
    for i in range(len(mask)):
        frame_bytes.append(mask[i])
    for i in range(len(data)):
        frame_bytes.append((ord_func(data[i]) ^ mask[(i % 4)]))
    frame_bytes = struct.pack(('!%iB' % len(frame_bytes)), *frame_bytes)
    self._socket.sendall(frame_bytes)
