You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
318 B
14 lines
318 B
#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=seconds;
|
|
return setsockopt(sock,SOL_SOCKET,SO_RCVTIMEO,&timeval,sizeof(timeval));
|
|
}
|
|
|