fix build on osx by disabling some keepalive params
This commit is contained in:
parent
468d6da711
commit
ac0f01843f
3 changed files with 8 additions and 1 deletions
|
|
@ -30,6 +30,8 @@ namespace fc
|
||||||
class time_point;
|
class time_point;
|
||||||
class time_point_sec;
|
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 to_variant( const uint16_t& var, variant& vo );
|
||||||
void from_variant( const variant& var, uint16_t& vo );
|
void from_variant( const variant& var, uint16_t& vo );
|
||||||
void to_variant( const uint32_t& var, variant& vo );
|
void to_variant( const uint32_t& var, variant& vo );
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace fc {
|
||||||
if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings),
|
if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings),
|
||||||
NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR)
|
NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR)
|
||||||
wlog("Error setting TCP keepalive values");
|
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
|
// This should work for modern Linuxes and for OSX >= Mountain Lion
|
||||||
int timeout_sec = interval.count() / fc::seconds(1).count();
|
int timeout_sec = interval.count() / fc::seconds(1).count();
|
||||||
if (setsockopt(my->_sock.native(), SOL_TCP, TCP_KEEPIDLE,
|
if (setsockopt(my->_sock.native(), SOL_TCP, TCP_KEEPIDLE,
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ namespace fc
|
||||||
void to_variant( const uint16_t& var, variant& vo ) { vo = uint64_t(var); }
|
void to_variant( const uint16_t& var, variant& vo ) { vo = uint64_t(var); }
|
||||||
// TODO: warn on overflow?
|
// TODO: warn on overflow?
|
||||||
void from_variant( const variant& var, uint16_t& vo ){ vo = static_cast<uint16_t>(var.as_uint64()); }
|
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 )
|
void to_variant( const std::vector<char>& var, variant& vo )
|
||||||
{
|
{
|
||||||
if( var.size() )
|
if( var.size() )
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue