diff options
author | fcolin | 2005-06-13 11:19:43 +0000 |
---|---|---|
committer | fcolin | 2005-06-13 11:19:43 +0000 |
commit | ca6cbf19ecdc5c9d5c5fb6cef3ae411cffc71589 (patch) | |
tree | 2944c1c61a1e5906bff153f0d4072400c7b9e084 /src/ivysocket.c | |
parent | cd85fe1c186c823232795124c1ecd242462e191b (diff) | |
download | ivy-c-ca6cbf19ecdc5c9d5c5fb6cef3ae411cffc71589.zip ivy-c-ca6cbf19ecdc5c9d5c5fb6cef3ae411cffc71589.tar.gz ivy-c-ca6cbf19ecdc5c9d5c5fb6cef3ae411cffc71589.tar.bz2 ivy-c-ca6cbf19ecdc5c9d5c5fb6cef3ae411cffc71589.tar.xz |
Ajout keepalive sur les sockets
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r-- | src/ivysocket.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ivysocket.c b/src/ivysocket.c index 50a4483..d777350 100644 --- a/src/ivysocket.c +++ b/src/ivysocket.c @@ -641,7 +641,18 @@ void SocketSendBroadcast (Client client, unsigned long host, unsigned short port perror ("*** send ***"); } va_end (ap ); } - +void SocketKeepAlive( Client client,int keepalive ) +{ + int alive = keepalive; + if (setsockopt(client->fd,SOL_SOCKET,SO_KEEPALIVE,(char*)&alive,sizeof(alive)) < 0) + { +#ifdef WIN32 + fprintf(stderr," setsockopt %d\n",WSAGetLastError()); +#endif + perror ("*** set socket option SO_KEEPALIVE ***"); + exit(0); + } +} /* Socket Multicast */ int SocketAddMember(Client client, unsigned long host ) |