f4ebe841a5
FossilOrigin-Name: 8a43dd9d05a4cb73210243ddd8df2a26f16c7ef2c4d4e36ab446de1f65d88223
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));
|
|
}
|