Commit 8106cda1 authored by Philip Carns's avatar Philip Carns

fix HG_Init() arguments for clients

- makes cci/tcp work correctly with margo examples
parent 42d6da76
......@@ -47,6 +47,7 @@ int main(int argc, char **argv)
hg_class_t *hg_class;
hg_addr_t svr_addr = HG_ADDR_NULL;
hg_handle_t handle;
char proto[12] = {0};
if(argc != 2)
{
......@@ -56,11 +57,13 @@ int main(int argc, char **argv)
/* boilerplate HG initialization steps */
/***************************************/
/* NOTE: the reason for passing in the server address into HG_Init() on
* the client is just to make sure that Mercury initializes the right
* transport.
/* initialize Mercury using the transport portion of the destination
* address (i.e., the part before the first : character if present)
*/
hg_class = HG_Init(argv[1], HG_FALSE);
for(i=0; i<11 && argv[1][i] != '\0' && argv[1][i] != ':'; i++)
proto[i] = argv[1][i];
hg_class = HG_Init(proto, HG_FALSE);
if(!hg_class)
{
fprintf(stderr, "Error: HG_Init()\n");
......
......@@ -47,6 +47,7 @@ int main(int argc, char **argv)
hg_class_t *hg_class;
hg_addr_t svr_addr = HG_ADDR_NULL;
hg_handle_t handle;
char proto[12] = {0};
if(argc != 2)
{
......@@ -56,11 +57,13 @@ int main(int argc, char **argv)
/* boilerplate HG initialization steps */
/***************************************/
/* NOTE: the reason for passing in the server address into HG_Init() on
* the client is just to make sure that Mercury initializes the right
* transport.
/* initialize Mercury using the transport portion of the destination
* address (i.e., the part before the first : character if present)
*/
hg_class = HG_Init(argv[1], HG_FALSE);
for(i=0; i<11 && argv[1][i] != '\0' && argv[1][i] != ':'; i++)
proto[i] = argv[1][i];
hg_class = HG_Init(proto, HG_FALSE);
if(!hg_class)
{
fprintf(stderr, "Error: HG_Init()\n");
......
......@@ -54,11 +54,11 @@ int main(int argc, char **argv)
/* boilerplate HG initialization steps */
/***************************************/
hg_class = HG_Init("tcp://localhost:1234", HG_FALSE);
hg_class = HG_Init("tcp", HG_FALSE);
if(!hg_class)
{
/* if tcp didn't work, try sm */
hg_class = HG_Init("sm://13/13", HG_FALSE);
hg_class = HG_Init("sm", HG_FALSE);
if(!hg_class)
{
fprintf(stderr, "Error: HG_Init()\n");
......
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