summaryrefslogtreecommitdiff
path: root/hiredis.c
diff options
context:
space:
mode:
authorViktor Söderqvist <viktor.soderqvist@est.tech>2023-05-29 22:25:34 +0200
committerGitHub <noreply@github.com>2023-05-29 13:25:34 -0700
commitb6a052fe0959dae69e16b9d74449faeb1b70dbe1 (patch)
tree9bf6d4456e0d2e0cc73f55fea5b6c764eb3ab156 /hiredis.c
parent3fa9b69443aa306b8219fc47aaffecd76e13a9ab (diff)
Helper for setting TCP_USER_TIMEOUT socket option (#1188)
* Implement redisSetTcpUserTimeout to set socket option TCP_USER_TIMEOUT * Documentation for redisSetTcpUserTimeout and some more undocumented functions Documentation for redisReconnect() and the setters of socket options: * redisKeepAlive() * redisEnableKeepAliveWithInterval() * redisSetTcpUserTimeout()
Diffstat (limited to 'hiredis.c')
-rw-r--r--hiredis.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hiredis.c b/hiredis.c
index 72502eb..9d8a500 100644
--- a/hiredis.c
+++ b/hiredis.c
@@ -953,6 +953,11 @@ int redisEnableKeepAlive(redisContext *c) {
return redisKeepAlive(c, REDIS_KEEPALIVE_INTERVAL);
}
+/* Set the socket option TCP_USER_TIMEOUT. */
+int redisSetTcpUserTimeout(redisContext *c, unsigned int timeout) {
+ return redisContextSetTcpUserTimeout(c, timeout);
+}
+
/* Set a user provided RESP3 PUSH handler and return any old one set. */
redisPushFn *redisSetPushCallback(redisContext *c, redisPushFn *fn) {
redisPushFn *old = c->push_cb;