Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct timeval timeout;
- timeout.tv_sec = 180;
- timeout.tv_usec = 0;
- if (setsockopt (sockfd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
- sizeof(timeout)) < 0)
- perror("setsockopt failed\n");
- if (setsockopt (sockfd, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout,
- sizeof(timeout)) < 0)
- perror("setsockopt failed\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement