Two small fixes

for keep listen, cannot "closesocket(s)" in while loop.
udp need use "sendto()".
development
MiniLight 2016-12-11 00:41:33 +08:00 committed by Lucas Teske
parent e892ab6a70
commit d86cf516b9
No known key found for this signature in database
GPG Key ID: 6C39C1C16A9DA7BE
1 changed files with 1 additions and 3 deletions

View File

@ -734,7 +734,7 @@ int main(int argc, char **argv)
fprintf(stderr, "\n");
}
r = send(s, (const char *)&dongle_info, sizeof(dongle_info), 0);
r = sendto(s, (const char *)&dongle_info, sizeof(dongle_info), 0, (struct sockaddr *)&remote, sizeof(remote));
if (sizeof(dongle_info) != r)
printf("failed to send dongle information\n");
@ -749,8 +749,6 @@ int main(int argc, char **argv)
pthread_join(tcp_worker_thread, &status);
pthread_join(command_thread, &status);
closesocket(s);
printf("all threads dead..\n");
curelem = ll_buffers;
ll_buffers = 0;