From 72ce8bce8dd655b6aefa33d0a74e883dad5202b5 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 29 Apr 2011 15:08:49 +0200 Subject: Add a SockTimeout(int socket, int seconds) function. Uses setsockopt(..., SOL_SOCKET, SO_{SND|RCV}TIMEO, ...). --- socket.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'socket.h') diff --git a/socket.h b/socket.h index 0c4ac001..cbdeec06 100644 --- a/socket.h +++ b/socket.h @@ -20,6 +20,9 @@ struct addrinfo; /** Create a new client socket; returns -1 on error */ int SockOpen(const char *host, const char *service, const char *plugin, struct addrinfo **); +/** Sets the send/receive timeouts for socket \a sock to \a timeout + * seconds. \return zero on success. */ +int SockTimeout(int sock, int timeout); /** Get a string terminated by an '\n' (matches interface of fgets). -- cgit v1.2.3