include tcp keepalive socket calls only on linux, freebsd and others
authorAlexandr Anikin <may@telecom-service.ru>
Tue, 15 Feb 2011 23:07:47 +0000 (23:07 +0000)
committerAlexandr Anikin <may@telecom-service.ru>
Tue, 15 Feb 2011 23:07:47 +0000 (23:07 +0000)
don't have these options on sockets.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307969 65c4cc65-6c06-0410-ace0-fbb531ad65f3

addons/ooh323c/src/ooSocket.c

index 128049b..5ec8ed5 100644 (file)
@@ -219,9 +219,11 @@ int ooSocketCreate (OOSOCKET* psocket)
    }
    setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, (const char *)&keepalive,
                        sizeof(keepalive));
+#ifdef __linux__
    setsockopt (sock, SOL_TCP, TCP_KEEPCNT, &keepcnt, sizeof(keepcnt));
    setsockopt (sock, SOL_TCP, TCP_KEEPIDLE, &keepidle, sizeof(keepidle));
    setsockopt (sock, SOL_TCP, TCP_KEEPINTVL, &keepintvl, sizeof(keepintvl));
+#endif
    *psocket = sock;
    return ASN_OK;
 }