'Recieve data with operation code.
return  value: tuple of operation code and string(byte array) value.'

def read_data(self):

    while ((not self.server_terminated) and (not self.client_terminated)):
        (fin, opcode, data) = self.read_frame()
        if (opcode in (self.OPCODE_TEXT, self.OPCODE_BINARY)):
            return (opcode, data)
        elif (opcode == self.OPCODE_CLOSE):
            self.client_terminated = True
            (close_code, close_reason) = (None, None)
            if (len(data) >= 2):
                close_code = struct.unpack('>H', data[:2])[0]
            if (len(data) > 2):
                close_reason = data[2:]
            self.close(close_code, close_reason)
            return (opcode, None)
        elif (opcode == self.OPCODE_PING):
            self.write_pong(data)
        else:
            raise ValueError(('Unknown    opcode    %s(fin:%s,    data:%s)' % (opcode, fin, data)))
    raise EOFError('EOF    when    reading    a    line,    websocket    has    been    closed')
