Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canghaiwuhen
OpenXG-RAN
Commits
4e88857b
Commit
4e88857b
authored
Apr 25, 2016
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let the soft-modem (or the program being traced, whatever it is) try
to connect until it succeeds
parent
a1aa6658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
common/utils/T/T.c
common/utils/T/T.c
+16
-4
No files found.
common/utils/T/T.c
View file @
4e88857b
...
@@ -113,15 +113,27 @@ void T_connect_to_tracer(char *addr, int port)
...
@@ -113,15 +113,27 @@ void T_connect_to_tracer(char *addr, int port)
int
T_shm_fd
;
int
T_shm_fd
;
#endif
#endif
if
(
strcmp
(
addr
,
"127.0.0.1"
)
!=
0
)
{
printf
(
"error: local tracer must be on same host
\n
"
);
abort
();
}
printf
(
"connecting to local tracer on port %d
\n
"
,
port
);
again:
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
s
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
s
==
-
1
)
{
perror
(
"socket"
);
exit
(
1
);
}
if
(
s
==
-
1
)
{
perror
(
"socket"
);
exit
(
1
);
}
a
.
sin_family
=
AF_INET
;
a
.
sin_family
=
AF_INET
;
a
.
sin_port
=
htons
(
port
);
a
.
sin_port
=
htons
(
port
);
a
.
sin_addr
.
s_addr
=
inet_addr
(
addr
);
a
.
sin_addr
.
s_addr
=
inet_addr
(
"127.0.0.1"
);
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
a
,
sizeof
(
a
))
==
-
1
)
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
a
,
sizeof
(
a
))
==
-
1
)
{
{
perror
(
"connect"
);
exit
(
1
);
}
perror
(
"connect"
);
close
(
s
);
printf
(
"trying again in 1s
\n
"
);
sleep
(
1
);
goto
again
;
}
/* wait for first message - initial list of active T events */
/* wait for first message - initial list of active T events */
get_message
(
s
);
get_message
(
s
);
...
...
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