mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
include tcp keepalive socket calls only on linux, freebsd and others
don't have these options on sockets. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user