actube/src/capwap/sock_set_recvtimeout.c
7u83@mail.ru 2bae9358d7 Initial commit
FossilOrigin-Name: c53d95729c009f8f80a7d63847cef7668ff73f8af0523ab65f7734696f85399c
2014-07-11 20:12:11 +00:00

15 lines
312 B
C

#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include "sock.h"
int sock_set_recvtimeout(int sock, int seconds)
{
struct timeval timeval;
memset(&timeval,0,sizeof(timeval));
timeval.tv_sec=1;
return setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,&timeval,sizeof(timeval));
}