connecting, writing and reading rados into c buffer