Merge remote-tracking branch 'upstream/phoenix' into http-server-improvements
This commit is contained in:
commit
e02a509b30
1 changed files with 6 additions and 6 deletions
|
|
@ -106,22 +106,22 @@ namespace fc {
|
|||
if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings),
|
||||
NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR)
|
||||
wlog("Error setting TCP keepalive values");
|
||||
#else
|
||||
# if !defined(__clang__) || (__clang_major__ >= 6)
|
||||
#elif !defined(__clang__) || (__clang_major__ >= 6)
|
||||
// This should work for modern Linuxes and for OSX >= Mountain Lion
|
||||
int timeout_sec = interval.count() / fc::seconds(1).count();
|
||||
if (setsockopt(my->_sock.native(), IPPROTO_TCP,
|
||||
# if defined( __APPLE__ )
|
||||
#if defined( __APPLE__ )
|
||||
TCP_KEEPALIVE,
|
||||
# else
|
||||
#else
|
||||
TCP_KEEPIDLE,
|
||||
# endif
|
||||
#endif
|
||||
(char*)&timeout_sec, sizeof(timeout_sec)) < 0)
|
||||
wlog("Error setting TCP keepalive idle time");
|
||||
#ifndef __APPLE__ // TCP_KEEPINTVL does not seem to work on 10.8.4
|
||||
if (setsockopt(my->_sock.native(), IPPROTO_TCP, TCP_KEEPINTVL,
|
||||
(char*)&timeout_sec, sizeof(timeout_sec)) < 0)
|
||||
wlog("Error setting TCP keepalive interval");
|
||||
# endif
|
||||
#endif // !__APPLE__
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue