Enlarge the timeout of protecting socket

This commit is contained in:
Max Lv
2018-01-11 22:10:46 +08:00
parent 512891c66f
commit 87e4bece84
+2 -2
View File
@@ -56,9 +56,9 @@ protect_socket(int fd)
return -1;
}
// Set timeout to 1s
// Set timeout to 3s
struct timeval tv;
tv.tv_sec = 1;
tv.tv_sec = 3;
tv.tv_usec = 0;
setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval));
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&tv, sizeof(struct timeval));