Enable TCP_KEEPALIVE behavior.
+=item MEMCACHED_BEHAVIOR_KEEPALIVE_IDLE
+
+Specify time, in seconds, to mark a connection as idle. This is only available as an option Linux.
+
=item MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE
Find the current size of SO_SNDBUF. A value of 0 means either an error
}
#endif
+#ifdef TCP_KEEPIDLE
+ if (ptr->root->tcp_keepidle)
+ {
+ int flag= 1;
+ int error;
+
+ error= setsockopt(ptr->fd, IPPROTO_TCP, TCP_KEEPIDLE,
+ &flag, (socklen_t)sizeof(int));
+ WATCHPOINT_ASSERT(error == 0);
+ if (error)
+ return MEMCACHED_FAILURE;
+ }
+#endif
+
if (ptr->root->flags.no_block)
{
int error;
self->io_msg_watermark= 500;
self->io_bytes_watermark= 65 * 1024;
+ self->tcp_keepidle= 0;
+
self->io_key_prefetch= 0;
self->cached_errno= 0;
self->poll_timeout= MEMCACHED_DEFAULT_TIMEOUT;
new_clone->io_bytes_watermark= source->io_bytes_watermark;
new_clone->io_key_prefetch= source->io_key_prefetch;
new_clone->number_of_replicas= source->number_of_replicas;
+ new_clone->tcp_keepidle= source->tcp_keepidle;
if (memcached_server_count(source))
rc= memcached_push(new_clone, source);
uint32_t io_msg_watermark;
uint32_t io_bytes_watermark;
uint32_t io_key_prefetch;
+ uint32_t tcp_keepidle;
int cached_errno;
int32_t poll_timeout;
int32_t connect_timeout;