Commit d003cb5b authored by Philip Carns's avatar Philip Carns

stub composed client lib path

parent ef9ae7a5
......@@ -82,6 +82,7 @@ int main(int argc, char **argv)
NULL);
/* register service APIs */
data_xfer_register_client(mid);
composed_register_client(mid);
/* find addr for server */
ret = margo_addr_lookup(mid, argv[1], &svr_addr);
......@@ -91,6 +92,7 @@ int main(int argc, char **argv)
assert(buffer);
data_xfer_read(mid, svr_addr, buffer, buffer_sz);
composed_read(mid, svr_addr, buffer, buffer_sz);
/* send one rpc to server to shut it down */
/* create handle */
......
......@@ -37,6 +37,46 @@ int data_xfer_register_client(margo_instance_id mid)
return(0);
}
void composed_read(margo_instance_id mid, hg_addr_t svr_addr, void *buffer, hg_size_t buffer_sz)
{
hg_handle_t handle;
delegator_read_in_t in;
delegator_read_out_t out;
int ret;
const struct hg_info *hgi;
/* create handle */
ret = HG_Create(margo_get_context(mid), svr_addr, delegator_read_id, &handle);
assert(ret == 0);
/* register buffer for rdma/bulk access by server */
hgi = HG_Get_info(handle);
assert(hgi);
ret = HG_Bulk_create(hgi->hg_class, 1, &buffer, &buffer_sz,
HG_BULK_WRITE_ONLY, &in.bulk_handle);
assert(ret == 0);
#if 0
HG_Set_target_id(handle, mplex_id);
#endif
/* Send rpc. Note that we are also transmitting the bulk handle in the
* input struct. It was set above.
*/
margo_forward(mid, handle, &in);
/* decode response */
ret = HG_Get_output(handle, &out);
assert(ret == 0);
/* clean up resources consumed by this rpc */
HG_Bulk_free(in.bulk_handle);
HG_Free_output(handle, &out);
HG_Destroy(handle);
return;
}
void data_xfer_read(margo_instance_id mid, hg_addr_t svr_addr, void *buffer, hg_size_t buffer_sz)
{
hg_handle_t handle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment