From 9dff5105fc01f52437d862bc95d40415f03179f0 Mon Sep 17 00:00:00 2001 From: "Allen.Dou" Date: Tue, 30 Apr 2013 00:11:57 +0800 Subject: Make KeepAlive optional Make Connection KeepAlive being optional instead of default. --- hiredis.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hiredis.c') diff --git a/hiredis.c b/hiredis.c index 958f58b..84baa8c 100644 --- a/hiredis.c +++ b/hiredis.c @@ -1092,6 +1092,13 @@ int redisSetTimeout(redisContext *c, struct timeval tv) { return REDIS_ERR; } +/* Enable connection KeepAlive. */ +int redisEnableKeepAlive(redisContext *c) { + if (redisKeepAlive(c, REDIS_KEEPALIVE_INTERVAL) != REDIS_OK) + return REDIS_ERR; + return REDIS_OK; +} + /* Use this function to handle a read event on the descriptor. It will try * and read some bytes from the socket and feed them to the reply parser. * -- cgit v1.2.3