fix build on osx by disabling some keepalive params

This commit is contained in:
Daniel Larimer 2014-04-11 17:06:57 -04:00
parent 468d6da711
commit ac0f01843f
3 changed files with 8 additions and 1 deletions

View file

@ -30,6 +30,8 @@ namespace fc
class time_point;
class time_point_sec;
void to_variant( const int16_t& var, variant& vo );
void from_variant( const variant& var, int16_t& vo );
void to_variant( const uint16_t& var, variant& vo );
void from_variant( const variant& var, uint16_t& vo );
void to_variant( const uint32_t& var, variant& vo );

View file

@ -84,7 +84,7 @@ 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
#elif !defined( __APPLE__ ) // TODO: add proper support for OS X Mavericks... SOL_TCP and TCP_KEEPIDLE are not defined
// 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(), SOL_TCP, TCP_KEEPIDLE,

View file

@ -15,6 +15,11 @@ namespace fc
void to_variant( const uint16_t& var, variant& vo ) { vo = uint64_t(var); }
// TODO: warn on overflow?
void from_variant( const variant& var, uint16_t& vo ){ vo = static_cast<uint16_t>(var.as_uint64()); }
void to_variant( const int16_t& var, variant& vo ) { vo = int64_t(var); }
// TODO: warn on overflow?
void from_variant( const variant& var, int16_t& vo ){ vo = static_cast<int16_t>(var.as_int64()); }
void to_variant( const std::vector<char>& var, variant& vo )
{
if( var.size() )