Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
nat_traversal
Commits
ca9fe2fb
Commit
ca9fe2fb
authored
May 18, 2017
by
Fong
Browse files
change recv order
parent
64dab16a
Changes
2
Hide whitespace changes
Inline
Side-by-side
main.c
View file @
ca9fe2fb
...
...
@@ -110,8 +110,6 @@ int main(int argc, char** argv)
}
printf
(
"enroll successfully, ID: %d
\n
"
,
c
.
id
);
pthread_t
tid
=
wait_for_command
(
&
c
.
sfd
);
if
(
peer_id
)
{
printf
(
"connecting to peer %d
\n
"
,
peer_id
);
if
(
connect_to_peer
(
&
c
,
peer_id
)
<
0
)
{
...
...
@@ -121,6 +119,8 @@ int main(int argc, char** argv)
}
}
pthread_t
tid
=
wait_for_command
(
&
c
.
sfd
);
pthread_join
(
tid
,
NULL
);
return
0
;
}
nat_traversal.c
View file @
ca9fe2fb
...
...
@@ -222,12 +222,10 @@ static void* server_notify_handler(void* data) {
}
}
verbose_log
(
"recv command from server"
);
peer
.
port
=
ntohs
(
peer
.
port
);
peer
.
type
=
ntohs
(
peer
.
type
);
printf
(
"recv command, ready to connect to %s:%d
\n
"
,
peer
.
ip
,
peer
.
port
);
printf
(
"recv
ed
command, ready to connect to %s:%d
\n
"
,
peer
.
ip
,
peer
.
port
);
struct
sockaddr_in
peer_addr
;
...
...
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