summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2015-04-16 20:46:53 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2015-04-16 21:01:00 +0200
commitb676007253ae48e2863abe969427fe3eb17a5b82 (patch)
tree31aedbfbf6527dac330e8f00f0d01aeb4d1a4386
parentd9e0b0f6abfbb8918f73607bdfcc707d0df3fd41 (diff)
downloadhiredict-b676007253ae48e2863abe969427fe3eb17a5b82.tar.xz
Document reconnect method
-rw-r--r--hiredis.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/hiredis.h b/hiredis.h
index dc4bf5d..358ae7b 100644
--- a/hiredis.h
+++ b/hiredis.h
@@ -168,7 +168,18 @@ redisContext *redisConnectUnix(const char *path);
redisContext *redisConnectUnixWithTimeout(const char *path, const struct timeval tv);
redisContext *redisConnectUnixNonBlock(const char *path);
redisContext *redisConnectFd(int fd);
+
+/**
+ * Reconnect the given context using the saved information.
+ *
+ * This re-uses the exact same connect options as in the initial connection.
+ * host, ip (or path), timeout and bind address are reused,
+ * flags are used unmodified from the existing context.
+ *
+ * Returns REDIS_OK on successfull connect or REDIS_ERR otherwise.
+ */
int redisReconnect(redisContext *c);
+
int redisSetTimeout(redisContext *c, const struct timeval tv);
int redisEnableKeepAlive(redisContext *c);
void redisFree(redisContext *c);