1
0

[Test] working on jetson

This commit is contained in:
Tony Yang 2021-12-28 02:41:56 +08:00
parent 011c463ea9
commit 8efbd54352

View File

@ -24,10 +24,6 @@ int sockfd = 0;
void clean_up(int signum) {
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);
close(sockfd);
@ -59,6 +55,10 @@ int main(int argc, char const *argv[]) {
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
bzero(&client_info, sizeof(client_info));
client_info.sin_family = PF_INET;