actube/src/cw/sock_set_recvtimeout.c
7u83@mail.ru f4ebe841a5 renamed capwap directory to cw.
FossilOrigin-Name: 8a43dd9d05a4cb73210243ddd8df2a26f16c7ef2c4d4e36ab446de1f65d88223
2016-03-03 19:46:20 +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));
}