Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Worker.N
openairinterface5G
Commits
4e88857b
Commit
4e88857b
authored
8 years ago
by
Cédric Roux
Browse files
Options
Downloads
Patches
Plain Diff
let the soft-modem (or the program being traced, whatever it is) try
to connect until it succeeds
parent
a1aa6658
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/utils/T/T.c
+16
-4
16 additions, 4 deletions
common/utils/T/T.c
with
16 additions
and
4 deletions
common/utils/T/T.c
+
16
−
4
View file @
4e88857b
...
...
@@ -113,15 +113,27 @@ void T_connect_to_tracer(char *addr, int port)
int
T_shm_fd
;
#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
);
if
(
s
==
-
1
)
{
perror
(
"socket"
);
exit
(
1
);
}
a
.
sin_family
=
AF_INET
;
a
.
sin_port
=
htons
(
port
);
a
.
sin_addr
.
s_addr
=
inet_addr
(
addr
);
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
a
,
sizeof
(
a
))
==
-
1
)
{
perror
(
"connect"
);
exit
(
1
);
}
a
.
sin_addr
.
s_addr
=
inet_addr
(
"127.0.0.1"
);
if
(
connect
(
s
,
(
struct
sockaddr
*
)
&
a
,
sizeof
(
a
))
==
-
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 */
get_message
(
s
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment