int SRLockClient::start_client () { SRClientContext ctx; char temp_char; ctx.ib_port = SERVER_IB_PORT; srand (generate_random_seed()); // initialize random seed TEST_NZ (establish_tcp_connection(SERVER_ADDR.c_str(), SERVER_TCP_PORT, &(ctx.sockfd))); DEBUG_COUT("[Comm] Client connected to LM on sock " << ctx.sockfd); TEST_NZ (ctx.create_context()); DEBUG_COUT("[Info] Context Created " << ctx.sockfd); TEST_NZ (RDMACommon::connect_qp (&(ctx.qp), ctx.ib_port, ctx.port_attr.lid, ctx.sockfd)); DEBUG_COUT("[Conn] QP connected!"); start_operation(ctx); // Sync so server will know that client is done mucking with its memory DEBUG_COUT("[Info] Client is done, and is ready to destroy its resources!"); TEST_NZ (sock_sync_data (ctx.sockfd, 1, "W", &temp_char)); /* just send a dummy char back and forth */ TEST_NZ(ctx.destroy_context()); }
int IPCohort::start_server () { IPCohortContext ctx; char temp_char; TEST_NZ (establish_tcp_connection(TRX_MANAGER_ADDR.c_str(), TRX_MANAGER_TCP_PORT, &ctx.sockfd)); TEST_NZ (ctx.create_context()); srand (time(NULL)); // initialize random seed start_benchmark(ctx); /* Sync so server will know that client is done mucking with its memory */ DEBUG_COUT("[Info] Cohort client is done, and is ready to destroy its resources!"); TEST_NZ (sock_sync_data (ctx.sockfd, 1, "W", &temp_char)); /* just send a dummy char back and forth */ TEST_NZ(ctx.destroy_context()); }