Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chuck cranor
margo
Commits
8106cda1
Commit
8106cda1
authored
Oct 11, 2016
by
Philip Carns
Browse files
fix HG_Init() arguments for clients
- makes cci/tcp work correctly with margo examples
parent
42d6da76
Changes
3
Hide whitespace changes
Inline
Side-by-side
examples/client-timeout.c
View file @
8106cda1
...
...
@@ -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
"
);
...
...
examples/client.c
View file @
8106cda1
...
...
@@ -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
"
);
...
...
examples/sleep.c
View file @
8106cda1
...
...
@@ -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
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment