Ejemplo n.º 1
0
    WriteResponse WriteFile(const string &path, string &buf, size_t size, off_t offset) {
        WriteRequest request;
        request.set_path(path);
        request.set_buf(buf);
        request.set_size(size);
        request.set_offset(offset);

        WriteResponse response;
        ClientContext context;
        Status status = stub_->WriteFile(&context, request, &response);
        if (status.ok()) {
            return response;
        }
        // TODO: Do something on failure here
        return response;
    }