more flexible keepalive options detection + awful options documentation

This commit is contained in:
Sergey KHripchenko
2012-04-06 20:04:35 +04:00
parent 0c3d917926
commit 4b303402a7
6 changed files with 286 additions and 28 deletions

View File

@@ -230,7 +230,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
errno = EINVAL;
return -1;
}
#ifdef ZMQ_HAVE_TCP_KEEPALIVE
#if defined ZMQ_HAVE_SO_KEEPALIVE
tcp_keepalive = val;
#endif
return 0;
@@ -247,7 +247,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
errno = EINVAL;
return -1;
}
#if defined ZMQ_HAVE_TCP_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPALIVE_OPTS
#if defined ZMQ_HAVE_SO_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPCNT
tcp_keepalive_cnt = val;
#endif
return 0;
@@ -264,7 +264,8 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
errno = EINVAL;
return -1;
}
#if defined ZMQ_HAVE_TCP_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPALIVE_OPTS
#if defined ZMQ_HAVE_SO_KEEPALIVE && (defined ZMQ_HAVE_TCP_KEEPIDLE || defined ZMQ_HAVE_TCP_KEEPALIVE)
tcp_keepalive_idle = val;
#endif
return 0;
@@ -281,7 +282,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
errno = EINVAL;
return -1;
}
#if defined ZMQ_HAVE_TCP_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPALIVE_OPTS
#if defined ZMQ_HAVE_SO_KEEPALIVE && defined ZMQ_HAVE_TCP_KEEPINTVL
tcp_keepalive_intvl = val;
#endif
return 0;