summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2013-05-01 09:23:17 -0700
committerPieter Noordhuis <pcnoordhuis@gmail.com>2013-05-01 09:23:17 -0700
commit91f47a1c198f78206ef02e791e0c5b5dfbeebe3a (patch)
tree0efcd2d651a075e0849cb45fdbcae4b613c297f5 /hiredis.c
parent63ce20dd15f83c6ff2bdab1bf3dcd1866e826c71 (diff)
parentbb3c4c17c45c89d980e2f4f59f59e55d13c77334 (diff)
Merge branch 'keepalive'
Also see pull request #161.
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c7
1 files changed, 7 insertions, 0 deletions
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.
*