2bae9358d7
FossilOrigin-Name: c53d95729c009f8f80a7d63847cef7668ff73f8af0523ab65f7734696f85399c
15 lines
312 B
C
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));
|
|
}
|