[Test] working on jetson
This commit is contained in:
parent
011c463ea9
commit
8efbd54352
@ -24,10 +24,6 @@ int sockfd = 0;
|
|||||||
void clean_up(int signum) {
|
void clean_up(int signum) {
|
||||||
if (sockfd == -1) exit(1);
|
if (sockfd == -1) exit(1);
|
||||||
|
|
||||||
int truthy = 1;
|
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &truthy, sizeof(int));
|
|
||||||
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &truthy, sizeof(int));
|
|
||||||
|
|
||||||
shutdown(sockfd, SHUT_RDWR);
|
shutdown(sockfd, SHUT_RDWR);
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
|
|
||||||
@ -59,6 +55,10 @@ int main(int argc, char const *argv[]) {
|
|||||||
exit(errno);
|
exit(errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int truthy = 1;
|
||||||
|
setsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, &truthy, sizeof(int));
|
||||||
|
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &truthy, sizeof(int));
|
||||||
|
|
||||||
// setup server info
|
// setup server info
|
||||||
bzero(&client_info, sizeof(client_info));
|
bzero(&client_info, sizeof(client_info));
|
||||||
client_info.sin_family = PF_INET;
|
client_info.sin_family = PF_INET;
|
||||||
@ -145,4 +145,4 @@ int main(int argc, char const *argv[]) {
|
|||||||
|
|
||||||
close(sockfd);
|
close(sockfd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user